<?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>TimeWaster's Place &#187; swapping</title>
	<atom:link href="http://www.timewaster.de/tag/swapping/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.timewaster.de</link>
	<description>Programming, Design, Tekkie Stuff and more</description>
	<lastBuildDate>Wed, 04 Aug 2010 14:02:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>On-the-fly Picture Swapping, how to get it work in MSIE</title>
		<link>http://www.timewaster.de/on-the-fly-picture-swapping-how-to-get-it-work-in-msie/</link>
		<comments>http://www.timewaster.de/on-the-fly-picture-swapping-how-to-get-it-work-in-msie/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 13:53:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[msie]]></category>
		<category><![CDATA[picture]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[swapping]]></category>

		<guid isPermaLink="false">http://www.timewaster.de/?p=146</guid>
		<description><![CDATA[To swap or reload a picture on the fly is easy with Javascript. Just give the img tag a unique id and execute the following command in javascript:
document.getElementById("picture").src = "/img/cool-picture.jpg";
Now comes the glitch in (guess where) Internet Explorer: If you want to reload a picture that has changed on the server (let&#8217;s say you have [...]]]></description>
			<content:encoded><![CDATA[<p>To swap or reload a picture on the fly is easy with Javascript. Just give the img tag a unique id and execute the following command in javascript:</p>
<p><code>document.getElementById("picture").src = "/img/cool-picture.jpg";</code></p>
<p>Now comes the glitch in (guess where) Internet Explorer: If you want to reload a picture that has changed on the server (let&#8217;s say you have overwritten the picture with a php gd-lib script in the background), the Internet Explorer (i call him msie, spoken &#8220;emsy&#8221;) always keeps the cached picture instead of reloading the picture from the server like opera and firefox do.<br />
You can fix this behaviour with a simple cache-avoiding technique: Add a random number as a parameter, as shown in the following code, that&#8217;s it.</p>
<p><code>document.getElementById("picture").src = "/img/cool-picture.jpg?r=" + Math.floor(Math.random() * 1000);</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.timewaster.de/on-the-fly-picture-swapping-how-to-get-it-work-in-msie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
