Determine image src in onload and onerror event handlers in IE
<p>How can I determine the image src of the image that triggered the event in the onload and onerror event handlers in IE?  This example code I threw together:</p>

<pre><code>&lt;script language="javascript" type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
&lt;script language="javascript" type="text/javascript"&gt;
function loadImages() {
   var goodImage = new Image();
   var missingImage = new Image();

   $(goodImage).bind('load', function(event){
      $("#log").append( $(event.target).attr('src') + ' WAS FOUND &lt;br&gt;');
   });

   $(missingImage).bind('load', function(event){
      $("#log").append( $(event.target).attr('src') + ' WAS FOUND &lt;br&gt;' );
   });

   $(goodImage).bind('error', function(event){
      $("#log").append( $(event.target).attr('src') + ' IS MISSING &lt;br&gt;');
   });

   $(missingImage).bind('error', function(event){
      $("#log").append( $(event.target).attr('src') + ' IS MISSING &lt;br&gt;');
   });

  goodImage.src = 'GOOD-IMAGE.GIF'; // this image exists
  missingImage.src = 'MISSING-IMAGE.GIF'; // this image doesn't exist
}

&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="loadImages();"&gt;
&lt;div id="log"&gt;&lt;/div&gt;
</code></pre>

<p>works in FF but in IE8 it prints out undefined for the $(event.target).attr('src') part.  I thought jQuery was supposed to normalize the event object for IE so that it acted like other browsers?  I've tried a number of permutations but haven't been able to get anything to work in IE8.</p>

<p>Anyway if anyone has a suggestion on how to figure out the image src in the onload and onerror event handlers that works in IE I would really appreciate it.  Or even how to figure out after the images have loaded which have loaded and which haven't (but not graphically - I need to generate an array containing the filenames of the images that didn't load).  Thanks!</p>
