I have a simple template I’m using a plug in (Jquery.tmpl()), and I want simply pass in an array of strings and setup my template to display those strings. I’ve used these plenty passing in objects but I can’t seem to find or figure out the syntax if you are not passing in an object and are just passing in a string.
Example:
var years = { 2011, 2012, 2013}
$.tmpl('blah', years).appendTo("#somediv");
$.template('blah', <div>(this is where I want the string value)</div>
So what is the syntax that I need to put in my template.
The correct syntax is actually {$data} which will give you the template item’s value.
Took some serious searching by finally found it buried in the doc with no examples.