title: javascript executing function after full image load
body: <p>I have the following line of javascritp <code>$("#hero_image img").attr('src', src);</code> to change an image. The following lines then do whatever they do based on the images new width which I was calling through <code>$("#hero_image img").width();</code>.</p>
  
  <p>However, how do I ensure that this image has fully loaded before getting the width, otherwise I will be returned with the old width? Setting a timeout isn't reliable enough.</p>