I have found several answers about this but in my undestanding they cover libraries located in same dir with calling file.
In my application, I currently have the following code inside index.html page head:
<script type="text/javascript"
src="https://apis.google.com/js/api.js"></script>
What I want to do is load and use the same library inside a .js file. The application is client-side and is currently using the following frameworks:
"serveup", "hem","es5-shimify", "json2ify", jqueryify".
I have tried using jquery 'require' but I got error message saying the module was not found, I am guessing it was looking for a local file.
Try this:
var fileref=document.createElement('script');
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", "https://apis.google.com/js/api.js");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With