What steps will reproduce the problem?
1. I have a template var index = jsontemplate.Template("<script type="text/javascript">function test(){alert('test')}</script><h2>{title}</h2>");
2. When loading the template the error "Uncaught SyntaxError: Unexpected identifier" is shown.
What is the expected output? What do you see instead? Should not error and have the function call test() available to call on the page. Instead it errors out due to the open braces in javascript "{". I have tried to use \u007B with the same result.
What version of the product are you using? On what operating system?
Windows 7,
Chrome 13.0.782.218,
json-template-0.8
jquery 1.5.1
Please provide any additional information below.
Sorry for the very late response -- there are a couple solutions: 1. Use {{}} or [] as your template delimiters. (the "meta" option to the constructor) 2. If you split your JavaScript over multiple lines so that { and } don't appear on the same line it will parse. 3. Escape the {}. {.meta-left} and {.meta-right} are { and }.