<?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: Use Custom Missing Image Graphics Using&#160;jQuery</title> <atom:link href="http://davidwalsh.name/custom-missing-image-jquery/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/custom-missing-image-jquery</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Thu, 09 Feb 2012 14:25:32 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3</generator> <item><title>By: Shaun Gilroy</title><link>http://davidwalsh.name/custom-missing-image-jquery/comment-page-1#comment-27253</link> <dc:creator>Shaun Gilroy</dc:creator> <pubDate>Fri, 14 Oct 2011 23:04:31 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1920#comment-27253</guid> <description>That code turned out unreadable.  Let me try this again:&lt;code&gt;$(&#039;img&#039;).each(function() {
$(this).error(function() {
$(this).attr({
src: &#039;/images/missing-image.jpg&#039;,
alt: &#039;Sorry!  This image is still caching!&#039;,
style:&#039;border: 1px solid #f00;width:110px;height:40px;&#039;
});
});
this.src = this.src;
});&lt;/code&gt;</description> <content:encoded><![CDATA[<p>That code turned out unreadable.  Let me try this again:</p><p><code>$('img').each(function() {<br
/> $(this).error(function() {<br
/> $(this).attr({<br
/> src: '/images/missing-image.jpg',<br
/> alt: 'Sorry!  This image is still caching!',<br
/> style:'border: 1px solid #f00;width:110px;height:40px;'<br
/> });<br
/> });<br
/> this.src = this.src;<br
/> });</code></p> ]]></content:encoded> </item> <item><title>By: Shaun Gilroy</title><link>http://davidwalsh.name/custom-missing-image-jquery/comment-page-1#comment-27252</link> <dc:creator>Shaun Gilroy</dc:creator> <pubDate>Fri, 14 Oct 2011 22:59:59 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1920#comment-27252</guid> <description>There&#039;s one small problem here.  There&#039;s no guarantee that the image will load after jQuery registers events.  If the image loads first, this code won&#039;t work.  This is especially likely on image-heavy pages.There is a workaround, though: add your error handler to the load event and explicitly reassign the image src.  This makes sure the error handler has been registered before the image loads.For example:
&lt;code&gt;
$(&#039;img&#039;).each(function() {
$(this).error(function() {
$(this).attr({
src: &#039;http://davidwalsh.name/dw-content/missing-image.jpg&#039;,
alt: &#039;Sorry!  This image is still caching!&#039;,
style:&#039;border: 1px solid #f00;width:110px;height:40px;&#039;
});
});this.src = this.src;
});
&lt;/code&gt;</description> <content:encoded><![CDATA[<p>There&#8217;s one small problem here.  There&#8217;s no guarantee that the image will load after jQuery registers events.  If the image loads first, this code won&#8217;t work.  This is especially likely on image-heavy pages.</p><p>There is a workaround, though: add your error handler to the load event and explicitly reassign the image src.  This makes sure the error handler has been registered before the image loads.</p><p>For example:<br
/> <code><br
/> $('img').each(function() {<br
/> $(this).error(function() {<br
/> $(this).attr({<br
/> src: '<a
href="http://davidwalsh.name/dw-content/missing-image.jpg&#039;" rel="nofollow">http://davidwalsh.name/dw-content/missing-image.jpg&#039;</a>,<br
/> alt: 'Sorry!  This image is still caching!',<br
/> style:'border: 1px solid #f00;width:110px;height:40px;'<br
/> });<br
/> });</p><p> this.src = this.src;<br
/> });<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: rp</title><link>http://davidwalsh.name/custom-missing-image-jquery/comment-page-1#comment-16177</link> <dc:creator>rp</dc:creator> <pubDate>Fri, 19 Feb 2010 17:49:53 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1920#comment-16177</guid> <description>Very cool. Just what I needed. Thanks!!!!!!!!!!!!!!!!!!!!</description> <content:encoded><![CDATA[<p>Very cool. Just what I needed. Thanks!!!!!!!!!!!!!!!!!!!!</p> ]]></content:encoded> </item> <item><title>By: ZK@Web Marketing Blog</title><link>http://davidwalsh.name/custom-missing-image-jquery/comment-page-1#comment-9947</link> <dc:creator>ZK@Web Marketing Blog</dc:creator> <pubDate>Sat, 20 Jun 2009 16:45:29 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1920#comment-9947</guid> <description>Hi I&#039;m using this plugin and it&#039;s working very well except for one problem. It seems to be interfering with the jQuery ui dialog feature. When I include $.idleTimer(120000) in my script firebug shows a &#039;too much recursion&#039; error when I attempt to close an open modal dialog. When I remove that line of code it works fine. Any ideas? Thanks in advance</description> <content:encoded><![CDATA[<p>Hi I&#8217;m using this plugin and it&#8217;s working very well except for one problem. It seems to be interfering with the jQuery ui dialog feature. When I include $.idleTimer(120000) in my script firebug shows a &#8216;too much recursion&#8217; error when I attempt to close an open modal dialog. When I remove that line of code it works fine. Any ideas? Thanks in advance</p> ]]></content:encoded> </item> <item><title>By: Tilal Husain</title><link>http://davidwalsh.name/custom-missing-image-jquery/comment-page-1#comment-9747</link> <dc:creator>Tilal Husain</dc:creator> <pubDate>Fri, 12 Jun 2009 14:56:06 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1920#comment-9747</guid> <description>I usually use  jquery&#039;s builtin function and it works perfectly$(&quot;img&quot;).error(function () {
$(this).unbind(&quot;error&quot;).attr(&quot;src&quot;, &quot;images/noimage.jpg&quot;);
}); </description> <content:encoded><![CDATA[<p>I usually use  jquery&#8217;s builtin function and it works perfectly</p><p>$(&#8220;img&#8221;).error(function () {<br
/> $(this).unbind(&#8220;error&#8221;).attr(&#8220;src&#8221;, &#8220;images/noimage.jpg&#8221;);<br
/> });</p> ]]></content:encoded> </item> <item><title>By: David Walsh</title><link>http://davidwalsh.name/custom-missing-image-jquery/comment-page-1#comment-9133</link> <dc:creator>David Walsh</dc:creator> <pubDate>Thu, 07 May 2009 12:26:35 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1920#comment-9133</guid> <description>&lt;p&gt;@Bassem: You could automate giving that class to all of the images using jQuery.&lt;/p&gt;</description> <content:encoded><![CDATA[<p>@Bassem: You could automate giving that class to all of the images using jQuery.</p> ]]></content:encoded> </item> <item><title>By: Bassem</title><link>http://davidwalsh.name/custom-missing-image-jquery/comment-page-1#comment-9129</link> <dc:creator>Bassem</dc:creator> <pubDate>Thu, 07 May 2009 09:43:57 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1920#comment-9129</guid> <description>But This means i have to give a &quot;.missing&quot; class to all images in my page ! ?? its not just a detection for the broken link </description> <content:encoded><![CDATA[<p>But This means i have to give a &#8220;.missing&#8221; class to all images in my page ! ?? its not just a detection for the broken link</p> ]]></content:encoded> </item> <item><title>By: Erik</title><link>http://davidwalsh.name/custom-missing-image-jquery/comment-page-1#comment-8744</link> <dc:creator>Erik</dc:creator> <pubDate>Thu, 16 Apr 2009 10:43:06 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1920#comment-8744</guid> <description>Do you know if it&#039;s possible to use the .live function to bind this behavior?
That would enable invalid dynamic images that are injected after the document.ready event to also have the same behavior..Besides that, thanks for a brilliant snippet..Cheers,Erik</description> <content:encoded><![CDATA[<p>Do you know if it&#8217;s possible to use the .live function to bind this behavior?<br
/> That would enable invalid dynamic images that are injected after the document.ready event to also have the same behavior..</p><p>Besides that, thanks for a brilliant snippet..</p><p>Cheers,</p><p>Erik</p> ]]></content:encoded> </item> <item><title>By: Jhon Doe</title><link>http://davidwalsh.name/custom-missing-image-jquery/comment-page-1#comment-8563</link> <dc:creator>Jhon Doe</dc:creator> <pubDate>Mon, 06 Apr 2009 12:50:09 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1920#comment-8563</guid> <description>Good job
umm....attr$(this).attr({
src: &#039;http://davidwalsh.name/dw-content/missing-image.jpg&#039;,
alt: &#039;Sorry!  This image is not available!&#039;,
title: &#039;Sorry!  This image is not available!&#039;,
style:&#039;border: 1px solid #f00;width:110px;height:40px;&#039;
});Support for firefox  :P</description> <content:encoded><![CDATA[<p>Good job<br
/> umm&#8230;.attr</p><p>$(this).attr({<br
/> src: &#8216;<a
href="http://davidwalsh.name/dw-content/missing-image.jpg&#039;" rel="nofollow">http://davidwalsh.name/dw-content/missing-image.jpg&#039;</a>,<br
/> alt: &#8216;Sorry!  This image is not available!&#8217;,<br
/> title: &#8216;Sorry!  This image is not available!&#8217;,<br
/> style:&#8217;border: 1px solid #f00;width:110px;height:40px;&#8217;<br
/> });</p><p>Support for firefox  :P</p> ]]></content:encoded> </item> <item><title>By: Rakesh Juyal</title><link>http://davidwalsh.name/custom-missing-image-jquery/comment-page-1#comment-8539</link> <dc:creator>Rakesh Juyal</dc:creator> <pubDate>Fri, 03 Apr 2009 13:55:06 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1920#comment-8539</guid> <description>So we can &quot;Use Custom Missing Image Graphics using JQuery or MooTools&quot;. :)</description> <content:encoded><![CDATA[<p>So we can &#8220;Use Custom Missing Image Graphics using JQuery or MooTools&#8221;. :)</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 1/17 queries in 0.011 seconds using disk: basic
Object Caching 865/866 objects using disk: basic

Served from: davidwalsh.name @ 2012-02-09 09:43:09 -->
