Click to See Complete Forum and Search --> : Force Refresh?


Dezzboy
12-16-2002, 10:18 AM
Heya guys,

Does anyone know how to script a normal html document so that it refreshes?

It's for a news blog that i'm doing. don't really want to have it refresh EVERY time you enter it. Maybe just every hour or so. Coz otherwise, the page has to upload all the graphics too often.

But if it's too tricky to script, i wouldn't mind it refreshing everytime.

I've tried searching around, but so far nothing really helpful. So i was wondering if it could be a simple javascript thingy.

Thanks,
Dezzboy

khalidali63
12-16-2002, 10:46 AM
Hello,
the code segment below will refresh the page after every 5 seconds.
I hope that helps...

<head>
<meta content="5" http-equiv="Refresh">
<title>Force refresh</title>
</head>

:-)

Khalid

Dezzboy
12-17-2002, 04:44 AM
Hi Khalid,

thanks for the tip. I tried it actually, but like you said... it refreshes EVERY 5 seconds.

Is there a way to do a refresh ONLY ONCE? thanks!..

Charles
12-17-2002, 04:58 AM
You need to set the Expires parameter in the HTTP response header. In whatever scripting language your blogger is written there is a way to do this, so do a little exploring and perhaps talk to your server people. As a last resort, some browsers might recognize <meta http-equiv="Expires" content="-1">.

Dezzboy
12-17-2002, 05:03 AM
Thanks for the tip, Charles!...
i'll do some searching on the Expires parameter.. thanks! :)

Kolja
12-17-2002, 05:08 AM
Another way is using JavaScript:

<script type="text/javascript">
<!--
var paramStr = unescape(location.search);
if (paramStr.length) paramStr = paramStr.substring(1, paramStr.length);

if (paramStr != "started")
window.setTimeout("window.location=window.location.href+'?started'",3000)
//-->
</script>

Dezzboy
12-17-2002, 05:22 AM
hey guys...

i did some search on the Expire parameter...

http://www.htmlgoodies.com/beyond/nocache.html

I tried it and it works like a charm!!

HTML GOODIES is one fantastic resource site!!!

and thanks Kolja, i'll hav a go with your suggestion as well..