I want to include jquery.js in myjs.js file. I wrote the code below for this.
var theNewScript=document.createElement(\"script\"); theNewScript.type=\"te
The problem is that the script doesn't load instantly, it takes some time for the script file to download into your page and execute (in case of jQuery to define $).
I would recommend you to use HeadJS. then you can do:
head.js("/path/to/jQuery.js", function() { $.get('myfile.php'); });