<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HTML &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Fri, 06 Jan 2023 17:11:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>HTML &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>HTML: Creating a Default Placeholder for Image that Fails to Load</title>
		<link>https://myshittycode.com/2014/01/06/html-creating-a-default-placeholder-for-image-that-fails-to-load/</link>
					<comments>https://myshittycode.com/2014/01/06/html-creating-a-default-placeholder-for-image-that-fails-to-load/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Mon, 06 Jan 2014 20:15:42 +0000</pubDate>
				<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=306</guid>

					<description><![CDATA[<p>PROBLEM Let&#8217;s assume our web application relies on an external system to provide the image link, for example: employee photo link of a company. If the image link is invalid, we will get the ugly looking &#8220;x&#8221; on certain browsers. SOLUTION To fix this, we can load an image placeholder from our own web application [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2014/01/06/html-creating-a-default-placeholder-for-image-that-fails-to-load/">HTML: Creating a Default Placeholder for Image that Fails to Load</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">PROBLEM</h2>



<p>Let&#8217;s assume our web application relies on an external system to provide the image link, for example: employee photo link of a company.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; title: ; notranslate">
&lt;img src=&quot;http://external/server/employeeId.jpg&quot;&gt;
</pre></div>


<p>If the image link is invalid, we will get the ugly looking &#8220;x&#8221; on certain browsers.</p>



<h2 class="wp-block-heading">SOLUTION</h2>



<p>To fix this, we can load an image placeholder from our own web application if the external image link fails to load for some reason:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; title: ; notranslate">
&lt;img src=&quot;http://external/server/employeeId.jpg&quot; onerror=&quot;this.src=&#039;http://server/app/resources/img/avatar.jpg&#039;&quot;&gt;
</pre></div><p>The post <a rel="nofollow" href="https://myshittycode.com/2014/01/06/html-creating-a-default-placeholder-for-image-that-fails-to-load/">HTML: Creating a Default Placeholder for Image that Fails to Load</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2014/01/06/html-creating-a-default-placeholder-for-image-that-fails-to-load/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">306</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 61/65 queries in 0.011 seconds using Disk

Served from: myshittycode.com @ 2026-02-18 01:41:03 by W3 Total Cache
-->