How do you get an html page to refresh automatically?

IBhacknU

Diamond Member
Oct 9, 1999
6,855
0
0
I'm setting up a page for my new webcam. A new image is uploaded every 15 seconds, but to view it, I currently have to hit refresh/reload on the browser.

Is there a way to have the page do this automatically with plain old HTML code? Is it a script thing? What's the easiest way to accomplish this?

THANKS!
 

IBhacknU

Diamond Member
Oct 9, 1999
6,855
0
0
Nevermind, answered my own question:

<HEAD>
<TITLE>YOUR PAGE TITLE HERE</TITLE>
<meta http-equiv=&quot;refresh&quot; content=&quot;20;url=http#//YOUR.PAGE'S.URL/HERE&quot;>
</HEAD>

(make sure you use a : not a # in the URL. I just did that so it didn't try to become a link ;-)

Secondly, you'll find that most browsers will grab the old images from the cache (stored on your local hard drive) instead of grabbing the most recent image on the server. There is a way to get around this but it only works in Netscape.

You can use the Netscape-only LOWSRC tag to trick Netscape into grabbing the image from the server again, by defining the LOWSRC image as the same file as the main webcam image, like this:


<img src=&quot;YOUR_IMAGE.JPG&quot; width=320 height=240 hspace=0 vspace=0 border=0 lowsrc=&quot;YOUR_IMAGE.JPG&quot;>

 

Scarpozzi

Lifer
Jun 13, 2000
26,391
1,780
126
Thanks IBhacknU...I made a webcam site and couldn't get the autorefresh to work in Netscape and searched for a solution, but most people that wrote documentation on it failed to mention how to fix the problem. GRACIOUS!