How to insert JavaScript code in a Handlebars template?
问题 Quoting Handlebars FAQ: How can I include script tags in my template? If loading the template via an inlined tag then you may need to break up the script tag with an empty comment to avoid browser parser errors: <script type="text/x-handlebars"> foo <scr{{!}}ipt src="bar"></scr{{!}}ipt> </script> Nevertheless, I can't seem to be able to implement this: document.getElementById('output').innerHTML = Handlebars.compile( document.getElementById("template").innerHTML )({}); <script src="https:/