title: Add onload function to an opening window
body: <p>How to add an <code>onload</code> function to an opened window? (target is "self", not <code>window.open</code>, just a regular link)</p>
  
  <p>Is it possible with <code>onbeforeunload</code> or something? Or add <code>onclick</code> to the "normal link"?</p>
  
  <p>I mean like this:</p>
  
  <pre><code>&lt;a href="page2.htm" onclick="theWindowIHaveOpened.onload = function(){alert('loaded')}"&gt;...
  </code></pre>