Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q912 How can I force the reload an image from the server after the image has been displayed, but only once?

You are here: irt.org | FAQ | JavaScript | Image | Q912 [ previous next ]

Try the following:

<script language="JavaScript"><!--
var loadedOnce = false;

<a href="/cgi-bin/toggleserver.pl" value="Reload"><img src="/images/server.jpg" onLoad="if (!loadedOnce) this.src='/images/server.jpg?' + (new Date()).getTime()"></a>

©2018 Martin Webb