Posted By

arnoldb on 07/21/09


refresh img picture

Versions (?)

Single Line Image Refresh

 / Published in: HTML


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.