You are here: irt.org | FAQ | JavaScript | Image | Q416 [ previous next ]
By adding a different search string value after the image href. The following reloads the image from the server every 10 seconds:
<img src="picture.gif" name="myImageName"> <script language="JavaScript"><!-- function reloadImage() { var now = new Date(); if (document.images) { document.images.myImageName.src = 'picture.gif?' + now.getTime(); } setTimeout('reloadImage()',10000); } setTimeout('reloadImage()',10000); //--></script>