![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4
![]() |
Force Image Refresh
Is there an easy way to force a page to always download an image using javascript?
|
|
|
|
|
|
#2 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4
![]() |
(NN4+, IE4+)
<BODY onload="document.images.img_gif.src='your_path_to_the_file/the_image_fil e.gif?' + Math.floor(Math.random() * 1000);"> <IMG name="img_gif" src=""> If anyone else has the same question, here is an answer I discovered that works well. |
|
|
|
|
|
#3 | |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 122
Rep Power: 3
![]() |
Quote:
same number twice in succession, and thus display the same image. A better solution it to append a timestamp to the url in the same way. --47.
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet" |
|
|
|
|
|
|
#4 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4
![]() |
That is a basic mythod I found, becayse I use ASP.NET I do a timestamp OnPreRender, so for me it works out well, because that is when the image is given its url for it's src from the database.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|