title: Can't get $(window).load() to work on a page loaded into a div
body: <p>Forgive me, I'm new to this.</p>
  
  <p>I have a collection of .html files and depending on which is selected I'm having it load into a div on a page, sort of like an iframe. I can get this all working fine, but my problem is with window onload events. I can get onload working on the main page, but the onload events included on the pages loaded into the div on the main page do not work, whether I write it into the .html file or call it from an external file. $(document).ready works, but I'm trying to make sure the javascript is loaded after everything else.</p>
  
  <p>Basically I don't know how to get window onload working on a page loaded into a div.</p>
  
  <p>Any help would be greatly appreciated. </p>
  
  <p>Edit: This would load one of the external pages into the main one:</p>
  
  <pre><code>$('div#socket').load('pages/' + thisTab + '.html');
  </code></pre>
  
  <p>where thisTab would be the name of one of the files and also the tab selected.</p>
  
  <p>and something like this would be at the bottom of one of the loaded pages:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function(){
  alert('1');
  });
  
  $(window).load(function(){
  alert('2');
  });
  $(window).bind("load", function() {
     alert('3');
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I only get the '1' to be alerted. </p>