Can this be included in a .js file?
<p>This code works when it is included in the HTML file, but I'd rather have it in a separate JS file.</p>

<p>Can that be done?</p>

<pre><code>&lt;script type="text/javascript"&gt;

window.onload = function() {
   var a = document.getElementById("mylink");

   a.onclick = function() {
      $('#c').empty();      
      return false;
   }
}
&lt;/script&gt;
</code></pre>

<p><strong>Update</strong></p>

<p>I have tried this, but doesn't work...</p>

<pre><code>$(document).ready(function(){

// other functions here

    window.onload = function() {
    var a = document.getElementById("mylink");
    a.onclick = function() {
        $('#c').empty();        
        return false;
    }
    }

    $('form').live('submit', function(){

...
</code></pre>
