title: How to call function after document ready AND image load?
body: <p>I was using something like this:</p>
  
  <pre><code>$(document).ready(function() {
    $('#my-img').load(function() {
      // do something
    });
  });
  </code></pre>
  
  <p>But sometimes it fails to execute the second callback (without throwing any errors, so there's nothing to do there), and I'm thinking that maybe the image is being loaded before the document is ready.</p>
  
  <p>If I don't use the $(document).ready() part, it works fine, so I think I'm gonna leave it that way for now. But someone told me that it was a good practice to always do this kind of thing as a callback on document ready, because the document might not be ready. Is that right?</p>
  
  <p>Any thoughts?</p>