현재 서버의 다른 폴더에서 ajax get을 사용하여 jquery 템플릿을 채우려고합니다. 나는 응답 텍스트를 채우고 싶었다. 나는 .tmpl ({..})을 통해 얻는다. 슬프게도 그것은 작동하지 않았다. 여기 내가하는 일이있다.jquery-tmpl on responseText 사용
var a = $.ajax({
method: 'GET',
url : 'TemplateUrl/template.html'
});
$.when(a).done(function(){
$(a.responseText).tmpl({...});
});
에서 responseText 내가이
Uncaught TypeError: Failed to construct 'Text': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
어쩌면 너희들이 얻을 템플릿을 채우기 위해 시도 할 때이
"<div>
<td class="ms-formbody">
<!-- FieldName="{{html FieldName}}"
FieldInternalName = "{{html FieldName}}"
FieldType = "SPFieldText" -->
{{html Text}}
</td>
</div>"
처럼 보이는 SharePoint 사이트의에서 HTML의 매우 간단한 조각이다 아이디어. 잘 될 것입니다. 당신이 그것을 인스턴스화하는 대신 함수로 온도()를 호출하려고하기 때문에 사전에 감사하고
인사말 크리스
빠른 답장을 보내 주셔서 감사합니다. 또한 새로운 $ (a.responseText) .tmpl ({...})을 시도했습니다. 슬프게도 그것은 나에게 같은 결과를 준다. 또한 먼저 수행 var b = new $ (a.responseText); b.tmpl ({...}); 이 작동하지 않습니다. – Chris