How to Load jQuery Template

GregT

New Member
I keep getting same error every time i try to load my jQuery template. On document ready i get list of Items as a json list, and on succes this code run:\[code\] function add(result) { var panel = $('#MainContent_Panel1'); for (var k = 0; k < result.d.length; k++) { $("#template").tmpl(result.d[k]).appendTo("#MainContent_Panel1"); } }\[/code\]Here is my Template : \[code\] <script id="template" type="text/x-jquery-tmpl"???????????????? > <div id ="myID" style="background-color: red"> <span questionLabelGroup="$i">Question : ${Uid}</span> <span questionTextGroup="$i">Hello ${Content}<br /></span> <span answerLabelGroup="$i">Answer : </span> <input type='text' questionID="$guid"/> <input type='button' Class='addAnswerButton' addQuestionButtonGroup='"$i"' value='http://stackoverflow.com/questions/12627933/Add Question' /> <hr /> </div> </script>\[/code\]and i keep getting this error: TypeError: $("#template").tmpl is not a function. Any ideas what i did wrong?
 
Back
Top