Questions? Call (860)407-2687
find us on:

Example Code to Auto Refresh More than 1 Image on Web Page

short url:

Below are three dummy images set refresh every 5 seconds image #1, 6 seconds image #2 and 7 seconds image #3. The trick is to make sure each image has a different, unique ID.

The html code for mulitple images on a single web is found in the text area below. Note: make sure to alter the html image code that is red to meet your needs, ie proper image ID, number of seconds between refreshes, etc. and make sure to specify a unique ID for EACH image and make sure the associated Javascript code refects that image id.

<img alt="Your desired image alt text." id="idOfImage1ToReload" onload="javascript:(function(){setTimeout(function(){document.getElementById('idOfImage1ToReload').src=document.getElementById('idOfImage1ToReload').src.split('?')[0] + '?time=' + new Date().getTime();},5000);}())" src="the url/web address to your image" title="Your desired image title text." />

CONTENT RELATED TO EXAMPLE CODE TO AUTO REFRESH MORE THAN 1 IMAGE ON WEB PAGE



How To Auto Refresh Image On Web Page

... images src. An images src is the web address of the image on the web server. By adding a different search query at the end of the images location on the web server, it forces the web server to serve u ...

Auto Refresh Image On Web Page Bookmarklet

... is is a free bookmarklet that allows you to auto refresh or auto reload any image on a web page at whatever interval you desire: A bookmarklet and a web browser extension is essentially the same exce ...

How To Put Mouse Cursor Inside Input Text Tex

... Demo of JS Cursor in Input at SPECIFIC POSITION. The Javascript code to put the cursor in a textbox or textarea, that contains text, and put the cursor at the END of the text only requires a slight m ...

COMMENTS ON EXAMPLE CODE TO AUTO REFRESH MORE THAN 1 IMAGE ON WEB PAGE

Feel free to submit your comment below. Anything that does not contribute and is just spam will automatically be deleted. Questions marked by * are required. Comments are checked by a human to make sure they are not spam/automated and are on topic and related to Example Code to Auto Refresh More than 1 Image on Web Page.

NAME:
EMAIL:
COMMENT:
HTML OK. Allowable HTML tags include: <p></p>, <i></i>, <b></b>, <em></em>, <strong></strong>, <ul><li></li></ul>, <ol><li></li></ol>
Question ❔
Back to Top