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)” />


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.