Meteor JS: use external script

<script> tags in body or templates aren’t executed by Meteor, they are parsed and then handled by Meteor’s templating system. You can’t expect a script tag in either of those to just work as it would with a normal HTML page.

The solution is to use Template events (where you could manually append the script tag to the body or something) or load it dynamically like you said. It’s not overkill, it’s how Meteor works – remember, there is no traditional HTML page or body, there’s just the Meteor API, and the Meteor API specifies that in order to load and execute external scripts, you must use the appropriate API methods.

Leave a Comment