I\'m trying to cobble together a php style include function for javascript. The route I\'m taking is through a XMLHttpRequest. The included file will load, but the functions
Instead of loading the JavaScript file via AJAX, why not create a tag and insert that into the page? That will allow the JavaScript to be parsed in the global scope. Take a look at how Scriptaculous' require function works