How to load a Javascript file within another Javascript file and execute file 2 before file 1?
<p>I have written a jQuery plugin, say <code>jquery.plugin.js</code>. I want to use this plugin on a large number of sites. </p>

<p>What I want to do is to write a piece of js code at the top of <code>jquery.plugin.js</code> which will load the <code>jquery.main.js</code> and execute it so that <code>$</code> is available to be used in <code>jquery.plugin.js</code>.</p>

<p>Thanks.</p>
