What is x-tmpl?

x-tmpl has no real meaning, it simply stops the browser from interpreting the script as javascript.

It’s mostly used with jquery templates or knockoutjs template binding.

At some point, a javascript data object will be used in conjunction with the template to render some html. The values in the data object will replace those marked with {%} and similar in the template, with some {%} sections reflecting code flow such as loops etc.

I’m not sure which templating library uses {%} however, it’s not jquery templates, jsrender or knockout. You’d have to check what libraries are being referenced in the sample code.

Leave a Comment