javascript - using multiple clauses in if in jquery template -
I want to use a variable if the console log in that section is in the jquery template:
< Pre> Unwanted syntax error: Unexpected token {
Here's my code:
var isactive = true; Var isPasive = false; Var isGuest = false; Var tmp = '& lt; Script & gt; ' + '{{Every strong}}' + '& lt; A href = "#" class = "patient" data-name = "$ {$ value.M_Adi soy}}" data-tt = "$ {$ value.M_TcKimlikNo}" data-tahlilgunu = "$ {$ value.M_TahlilGunu} "& Gt; $ {M_Adi Soyadi} '+' {{if $ value.M_HastaBulunmaDurumu == "1" & amp; Amp; $ {IsActive}}} '+' & lt; Img id = "imgMember _ $ {$ value.M_TcKimlikNo}" src = "picture / greenmember.png" title = "istina clinic and dioob kytellariala irtusiveur." Style = "width: 15px; height: 15px;" /> '+' {{Else $ value.M_HastaBulunmaDurumu == "2"}} '+' & lt; Img id = "imgMember _ $ {M_TcKimlikNo}" src = "picture / bluemember.png" title = "Click on my computer DYOB System Industries Clinniginized Goldmuure Lutfen DioBb Systemamine Cadnier Yappian." Style = "Width: 15px; Height : 15px; " /> '+' {{Else $ value.M_HastaBulunmaDurumu == "3"}} '+' & lt; Img id = "imgMember _ $ {M_TcKimlikNo}" src = "images / redmember.png" title = "Click on my computer DYOB Systemmind Sizin kliniğinizde görünüyor. Style style =" width: 15px. ; Height: 15px; " /> '+' {{/ If}} '+' & lt; Img id = "imgResult _ $ {$ value.M_TcKimlikNo}" /> + '& Lt; Img id = "imgInfo _ $ {$ value.M_TcKimlikNo}" /> + '& Lt; / A & gt; + '{{/ Each}}' + '& lt; / Script & gt; ';
I use jquery.tmpl.min.js. If I should do to use the variable then
A general approach to changing its variable You can snippet the following JavaScript strings;
var tmp = '& lt; Script & gt; ' + ... + '& lt; \ / Script & gt; . ('$ {IsActive}', isActive) ('$ {Isassy}', isPassive). (Change to '$ {IsGuest}', isGuest)
For more detailed solutions to your problem, we need information about framework and template engine that you are using .
Edit:
I saw that the closing script tag generates an error that can avoid script tags like you:
& lt ; \ / Script & gt;
Comments
Post a Comment