Posted By

arnoldb on 07/21/09


Tagged

refresh img picture


Versions (?)

Single Line Image Refresh


 / Published in: HTML
 

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

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.

  1. <img src=”image.jpg” id=”reloader” onload=”setTimeout(’document.getElementById(\’reloader\’).src=\’image.jpg?\’+new Date().getMilliseconds()’, 5000)/>

Report this snippet  

You need to login to post a comment.