<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: Image onLoad Event + JavaScript Issue with Internet&#160;Explorer</title> <atom:link href="http://davidwalsh.name/image-load-event/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/image-load-event</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Thu, 09 Feb 2012 02:40:12 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3</generator> <item><title>By: viaria</title><link>http://davidwalsh.name/image-load-event/comment-page-1#comment-24383</link> <dc:creator>viaria</dc:creator> <pubDate>Fri, 10 Jun 2011 14:25:11 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4986#comment-24383</guid> <description>good solution thanks, just for you to know the corner copy button of second black box is not working. chrome win7</description> <content:encoded><![CDATA[<p>good solution thanks, just for you to know the corner copy button of second black box is not working. chrome win7</p> ]]></content:encoded> </item> <item><title>By: Jim</title><link>http://davidwalsh.name/image-load-event/comment-page-1#comment-22730</link> <dc:creator>Jim</dc:creator> <pubDate>Mon, 14 Feb 2011 20:35:53 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4986#comment-22730</guid> <description>Just ran across this.  Thanks for the solution.</description> <content:encoded><![CDATA[<p>Just ran across this.  Thanks for the solution.</p> ]]></content:encoded> </item> <item><title>By: alec</title><link>http://davidwalsh.name/image-load-event/comment-page-1#comment-18588</link> <dc:creator>alec</dc:creator> <pubDate>Mon, 05 Jul 2010 21:52:11 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4986#comment-18588</guid> <description>There is nothing IE-related or even remotely surprising about this. You need to be aware of the fact that JS can be multi-threaded, and that all requests for external resources are asynchronous (non-blocking). By setting the src property you are in effect spawning a new thread to go get that image, and attempting to set handlers or write inline code around a thread that is already running is just asking for trouble.You wouldn&#039;t try to set event handlers on an XmlHttpRequest after calling send() would you? The principal is exactly the same.</description> <content:encoded><![CDATA[<p>There is nothing IE-related or even remotely surprising about this. You need to be aware of the fact that JS can be multi-threaded, and that all requests for external resources are asynchronous (non-blocking). By setting the src property you are in effect spawning a new thread to go get that image, and attempting to set handlers or write inline code around a thread that is already running is just asking for trouble.</p><p>You wouldn&#8217;t try to set event handlers on an XmlHttpRequest after calling send() would you? The principal is exactly the same.</p> ]]></content:encoded> </item> <item><title>By: David Walsh</title><link>http://davidwalsh.name/image-load-event/comment-page-1#comment-18155</link> <dc:creator>David Walsh</dc:creator> <pubDate>Fri, 11 Jun 2010 13:36:59 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4986#comment-18155</guid> <description>@Adardesign:  That&#039;s not a terrible solution but you&#039;re preventing caching instead of modifying your code.  Not a good trade off.</description> <content:encoded><![CDATA[<p>@Adardesign:  That&#8217;s not a terrible solution but you&#8217;re preventing caching instead of modifying your code.  Not a good trade off.</p> ]]></content:encoded> </item> <item><title>By: Adardesign</title><link>http://davidwalsh.name/image-load-event/comment-page-1#comment-18154</link> <dc:creator>Adardesign</dc:creator> <pubDate>Fri, 11 Jun 2010 13:28:57 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4986#comment-18154</guid> <description>I had the same issue lately, I added a dynamic parameter to the image src like
path/to/img.jpg+ &quot;?&quot; + new Date().getTime();This makes sure it doesn&#039;t take the image from cache since it has a new parameter value each time.Your solution solves the problem with a much clearer and more efficient way.Thank</description> <content:encoded><![CDATA[<p>I had the same issue lately, I added a dynamic parameter to the image src like<br
/> path/to/img.jpg+ &#8220;?&#8221; + new Date().getTime();</p><p>This makes sure it doesn&#8217;t take the image from cache since it has a new parameter value each time.</p><p>Your solution solves the problem with a much clearer and more efficient way.</p><p>Thank</p> ]]></content:encoded> </item> <item><title>By: Richard</title><link>http://davidwalsh.name/image-load-event/comment-page-1#comment-18137</link> <dc:creator>Richard</dc:creator> <pubDate>Fri, 11 Jun 2010 05:47:48 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4986#comment-18137</guid> <description>Brilliant work, I had the same issue some time ago.</description> <content:encoded><![CDATA[<p>Brilliant work, I had the same issue some time ago.</p> ]]></content:encoded> </item> <item><title>By: Nickolas Simard</title><link>http://davidwalsh.name/image-load-event/comment-page-1#comment-18129</link> <dc:creator>Nickolas Simard</dc:creator> <pubDate>Thu, 10 Jun 2010 20:31:11 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4986#comment-18129</guid> <description>IE is plain crazy sometimes... ok, ALL the time!</description> <content:encoded><![CDATA[<p>IE is plain crazy sometimes&#8230; ok, ALL the time!</p> ]]></content:encoded> </item> <item><title>By: Marcel M.</title><link>http://davidwalsh.name/image-load-event/comment-page-1#comment-18128</link> <dc:creator>Marcel M.</dc:creator> <pubDate>Thu, 10 Jun 2010 19:57:04 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4986#comment-18128</guid> <description>For this example it would add more code, but you can check if a img element has been loaded by its &quot;complete&quot; attribute.&lt;code&gt;
if(img.complete) imgLoaded();
else img.addEvent(&#039;load&#039;, imgLoaded);
&lt;/code&gt;</description> <content:encoded><![CDATA[<p>For this example it would add more code, but you can check if a img element has been loaded by its &#8220;complete&#8221; attribute.</p><p><code><br
/> if(img.complete) imgLoaded();<br
/> else img.addEvent('load', imgLoaded);<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: David Walsh</title><link>http://davidwalsh.name/image-load-event/comment-page-1#comment-18125</link> <dc:creator>David Walsh</dc:creator> <pubDate>Thu, 10 Jun 2010 18:13:24 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4986#comment-18125</guid> <description>@Kendall:  Yep, I&#039;m upgrading a lightbox.</description> <content:encoded><![CDATA[<p>@Kendall:  Yep, I&#8217;m upgrading a lightbox.</p> ]]></content:encoded> </item> <item><title>By: Tim</title><link>http://davidwalsh.name/image-load-event/comment-page-1#comment-18124</link> <dc:creator>Tim</dc:creator> <pubDate>Thu, 10 Jun 2010 18:04:49 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4986#comment-18124</guid> <description>Great pick up! I ran into this issue (not knowing until now) just last week, I moved on to another project but I am now going to go back and revisit that code.Thanks!</description> <content:encoded><![CDATA[<p>Great pick up! I ran into this issue (not knowing until now) just last week, I moved on to another project but I am now going to go back and revisit that code.</p><p>Thanks!</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching using disk: basic
Object Caching 865/866 objects using disk: basic

Served from: davidwalsh.name @ 2012-02-09 01:32:55 -->
