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/blog/jquery-include/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.