How to add jQuery in JS file
<p>I have some code specific to sorting tables.  Since the code is common in most pages I want to make a JS file which will have the code and all the pages using it can reference it from there. </p>

<p>Problem is: How do I add jQuery, and table sorter plugin into that .js file?</p>

<p>I tried something like this:</p>

<pre><code>document.writeln('&lt;script src="/javascripts/jquery.js" type="text/javascript"&gt;&lt;/script&gt;');
document.writeln('&lt;script type="text/javascript" src="/javascripts/jquery.tablesorter.js"&gt;&lt;/script&gt;');
</code></pre>

<p>but this seems to not work. </p>

<p>What is the best way to do this?</p>
