I am using jsrender: JsRender v1.0pre
Unfortunately, I cannot update to the latest version.
I wanted to use a conditional statement in my template like so:
{{if IsSometing}}
SomeText
{{/if}}
However, this throws an error in the jsrender code:
if ( !current ) {
throw "Expected block tag";
}
Will conditional statements work for templates in this version? If so, how? I have a jsfiddle here with the version I am using.
The conditional statement has to be moved into the first cell of the template to get the error.
Thanks
That is a very old version, and the syntax was different at that time.
{{#if IsSomething}}
SomeText
{{/if}}
If you really cannot update to the latest JsRender, then at least you need to grab the set of sample and demo pages from GitHub which correspond to your version. I'm not sure exactly which commit you are using. Here is one such page:
Otherwise you are just going to be guessing at syntax and features for your version...