Single Line Image Refresh


/ Published in: HTML
Save to your folder(s)

This will refresh an image based on time, all in one line of code. Change the image name/path and the time to refresh in milliseconds.


Copy this code and paste it in your HTML
  1. <img src=”image.jpg” id=”reloader” onload=”setTimeout(’document.getElementById(\’reloader\’).src=\’image.jpg?\’+new Date().getMilliseconds()’, 5000)” />

URL: http://www.arnoldb.com/2009/06/06/refresh-an-image-with-a-single-line-of-code/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.