Banner Refresh Problem

mikebarbaro

New Member
Hello,

I have a site with several banners and backgrounds that I update each week. They are all just standard JPG images. The problem is that when I update them and go to the site to see them I have to refresh the page. How can I get it so that the new images load just by visiting the site? Please help. Thank you.
 

DHDdirect

New Member
Depending on the language you are using you can assign a random value to the images. So individual browsers think they are new images that need to be loaded.

PHP Example:
Code:
<img src="img.jpg?rand=<?=rand(1,1000);?>" />

ASP Example:
Code:
<img src="img.jpg?rand=<%=now()%>" />

I'm sure there would be a way in javascript but i'd have to work it out.
 
Top