Ideally id like to be able to call in a library, then run a block of code all from a single file.
Is this possible?
Yes, you can manipulate the DOM by adding a script tag to the header while or after the page loads.
Something like this, found on Google:
var oHead = document.getElementsByTagName('HEAD').item(0);
var oScript= document.createElement("script");
That works great loading the script in - but for some reason non of my code based on the prototype library works if I load things that way.
Maybe the prototype based code isn't being fired properly because of the late-loading of the library.
All code depending on the library should be loaded after the library. Perhaps there's some documentation on the Prototype site detailing this kind of late-loading?
Yes thats my thinking, im pretty sure the prototype library is loading AFTER my code so I will see what I can dig up.
Thanks for all your help!
You can read more about it here http://requirejs.org/
This topic is now closed. New replies are no longer allowed.