For those of you who like jQuery but cannot find any sensible way of including external JavaScript files, here is a solution for you. I come up with this solution while developing Mashina, my browser based exploitation framework.
http://www.gnucitizen.org/static/blog/2007/04/jquery-include.js
In order to include JavaScript source files you have to do the following:
$.include('http://path/to/script1.js');
$.include('http://path/to/script2.js');
$(document).ready(function () {
// the files are loaded, so now you can use them...
});
As you can see, everything is very jQuery like so you shouldn’t have any problems.
For local files if you use async false then you don’t have to do the callback timer (js stops execution until the file is loaded). This has been working for me in IE6, FF2, & Safari: