I just stumbled upon something I\'ve never seen before. In the source of Backbone.js\'s example TODO application (Backbone TODO Example) they had their templates inside a
By setting script tag type
other than text/javascript
, browser will not execute the internal code of script tag. This is called micro template. This concept is widely used in Single page application(aka SPA).
For micro template, type of the script tag is text/template
. It is very well explained by Jquery creator John Resig http://ejohn.org/blog/javascript-micro-templating/