When we try to reload the image using JavaScript it does not work due to the browser caching the image.
The workaround for this is to append a "#" at the end of the image path ie say the image is
<img src="http://www.blogger.com/captcha.php" id="captcha" /><a href="javascript://document.getElementById().src+='#'">Reload</a>
This way we fool the browser to think its a different image and the browser reloads the image. Simple eh?
Sunday, November 16, 2008
Force reload an image using javascript
Subscribe to:
Post Comments (Atom)
1 comments:
perfect I like it.
Post a Comment