Normal JavaScript methods do not work, because it is not JavaScript; just wrapping the template in //<![CDATA[ ... //]]>or //<!-- ... //-->just causing the worst problems.
As stated in this blog post , it seems that the best options are either using HTML 5, or placing the template in an external file and including that.
$(document).ready(function() {
$.get('template.html', function(content) {
$.template('template name', content);
});
});
source
share