load client side js library
-
Ok, this might be a popular topic but I am having a hard time to properly load a client javascript library.
I read about the Requirejs but I couldn't make it work. Can someone point out an example that shows how to do that?
I am trying to use this one: https://github.com/jackocnr/intl-tel-input
Example: https://codepen.io/Subversivo58/pen/qpJMjy
loading the javascript on the template with <script> tags work but not properly...it works fine when I open the url of the route I created but if I load the app and then click on a link pointing to that route it doesn't work. Thanks!
-
The theme this forum is using loads pulling.js as a requirejs library
plugin.json
https://github.com/NodeBB/nodebb-theme-persona/blob/master/plugin.json#L17Required here https://github.com/NodeBB/nodebb-theme-persona/blob/master/public/persona.js#L175
And this is the library that's loaded https://github.com/nodebb/pulling