Closed sandord closed 12 years ago
This is because you are using the wrong syntax. {{else}} is a tag. There is no 'else if' syntax. The correct syntax is:
{{#if Sold}}sold{{else Pending}}pending{{else Vacant}}vacant{{/if}
Thanks, my bad. It's strange though that only IE8 bails out on that code, not IE9, FF9 or Chrome...
It is because {{else if Pending}} will treat 'if' as another data property - so it becomes (in code) else if(data.if || data.Pending). data.if is not supported in IE8 (it requires you to write data["if"] - because if is a key word. In IE9, Chrome, etc. keywords are accepted, so data.if will have a value undefined, but will not throw...
Ah, that makes a lot of sense. Thanks for explaining.
There will be a specific error message for this, coming up in the next commit...
In IE8 I the following template throws an exception in IE8 (expected identifier, line 552 in jsrender.js):
Writing it like this does work though: