$('img').load() firing too soon
<p>I'm trying to get some images' aspect ratios using their load() methods.</p>

<pre><code>$('img').load(function(){
    alert(this.src);
    alert($(this).width());
    setAspectRatio(this);
});
</code></pre>

<p>(this.src) tells me what I expect to hear. ($(this).width()) gives me 0.</p>

<p>I found this in the documentation for load():</p>

<blockquote>
  <p>Caveats of the load event when used with images</p>
  
  <p>A common challenge developers attempt to solve using the .load() shortcut is to execute a function when an image (or collection of images) have completely loaded. There are several known caveats with this that should be noted. These are:</p>
  
  <ul>
  <li>It doesn't work consistently nor reliably cross-browser</li>
  <li>It doesn't fire correctly in WebKit if the image src is set to the same src as before</li>
  <li>It doesn't correctly bubble up the DOM tree</li>
  <li>Can cease to fire for images that already live in the browser's cache</li>
  </ul>
</blockquote>

<p>A couple of those items sound a little vague to me, but these images were appended into an element using the get() method, so my best guess is that my problem has something to do with that.</p>

<p>This doesn't seem like an unusual circumstance, but Google isn't giving me anything. Has anybody here encountered this?</p>
