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 Put Mouse Cursor Inside Input Text Tex

... owsers and devices. The above code successfully puts the cursor in the input element through sheer Javascript code but does not let you specify at what position. If there is nothing in the input eleme ...

How To Create Javascript Bookmarklet

... at all it won't be easy, but the difference between regular Javascript code and a bookmarklet is you don't have to own the website you are going to run the Javascript bookmarklet code on. This is fant ...

View Hidden Content On Any Website Bookmarkle

... ess of this pages loading. Once the page finished loading code made that page load progress bar invisible because it was no longer needed. Other reasons a web page may have hidden content include: No ...

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