jQuery conditional loading in template

Mesmereyesed

New Member
I want to load my template conditionally in Jquery. what i have right now : \[code\] <script type="text/html"???????????????? id="template"> <div id ="myID" style="background-color: #009ACF"> <span questionLabelGroup="$i">Question :</span> <span questionTextGroup="$i">$textboxText<br /></span> <span answerLabelGroup="$i">Answer : </span> <input type='text' questionID="$guid"/> {{if buildLinkb("id") == null }} <input type='button' Class='addAnswerButton' addQuestionButtonGroup='"$i"' value='http://stackoverflow.com/questions/12610193/Add Question' /> <hr /> </div> {{/if}}</script>\[/code\]where buildLinkb("id") is :\[code\] function buildLinkb(param) { var val = document.URL; var url = val.substr(val.indexOf(param)) var n=parseInt(url.replace(param+"=","")); alert(n+1); }\[/code\]So what happends is, on document ready i am loading this template from ajax call to server. In url send id parameter conditionally, and i want to load parts of a template if id does not exsists. Any way of diong it?
 
Back
Top