title: JQuery is waiting for images to load before executing document.ready
body: <p><b>Update:</b>
  This bug has been confirmed by at least two others. Even if you dont read my full post - if you're reading this and using JQuery 1.3.1 then <strong>stop using it</strong> if you're relying on any handlers that you want to execute when the DOM is complete but before the page's images have loaded.</p>
  
  <p><strong>Update2</strong>: Thanks to <a href="https://stackoverflow.com/users/20/tom">Tom</a> (user id 20!)  for posting the <a href="http://dev.jquery.com/ticket/3988#preview" rel="nofollow noreferrer">link to the ticket</a> on the jQuery bug tracker. </p>
  
  <p><strong>Update3 - 2009/01/28:</strong> The issue has been properly resolved (for those for whom reverting to 1.2.6 is not an option). For anyone currently using 1.3.1 and needing an immediate fix you can read the accepted answer below for direction. Thanks John.</p>
  
  <hr>
  
  <p>I just upgraded to JQuery 1.3.1, and it took me several hours to realize that my beloved </p>
  
  <pre><code>$(function( ) {  ... }
  </code></pre>
  
  <p>syntax was now waiting for the entire page to load (including images) before executing the function body. I was seeing <a href="https://stackoverflow.com/questions/477348/">strange behavior</a> when trying to integrate Yahoo's menus. (Fortunately I had some slow loading images on my page which made me aware of the problem)!</p>
  
  <p>I made a test file becasue I figured something more complex was going on, but I still had the same symptoms even with this simple file.</p>
  
  <pre><code>&lt;head&gt;
     &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"&gt;&lt;/script&gt;   
     &lt;script&gt;
      $(function() {    
        alert("Ready"); 
      });
    &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;      
    &lt;img src="&lt;PATH_TO_DYNAMIC_IMAGE&gt;_1.jpg" /&gt;
    &lt;img src="&lt;PATH_TO_DYNAMIC_IMAGE&gt;_2.jpg" /&gt;
    &lt;img src="&lt;PATH_TO_DYNAMIC_IMAGE&gt;_3.jpg" /&gt;
    &lt;img src="&lt;PATH_TO_DYNAMIC_IMAGE&gt;_4.jpg" /&gt;       
  &lt;/body&gt;
  </code></pre>
  
  <p>Different versions of JQuery had different results:</p>
  
  <ul>
  <li>What happens in version 1.2.6 is that alert box is shown instantly and then I see the images loading behind it (expected and documented behavior).</li>
  <li>What happens in version 1.3.1 is that the images all load and only then will the alert box be shown.</li>
  </ul>
  
  <p>Whats going on! Is this a new feature (I cant imagine why) or a bug?</p>
  
  <p><strong>Important: This only seems to be an issue in IE and not firefox</strong></p>
  
  <p><em>Sorry I dont have a dynamic image file that is publically accessible to make it easier for others to see this. If you want to test it out I suggest using a large image file picked randomly from google images and clear your cache.</em></p>