forced reload
i need a page to be reloaded, every time a user comes back to it. i suppose i can do that easily with a javascript. at several javascript-resources i haven't found anything...
can you help me?
thanks a lot
a
i need a page to be reloaded, every time a user comes back to it. i suppose i can do that easily with a javascript. at several javascript-resources i haven't found anything...
can you help me?
thanks a lot
a
Mark Hensler posted this at 05:03 — 16th November 2000.
He has: 4,048 posts
Joined: Aug 2000
reloaded everytime a user comes back... sounds like a job for no-cache. Have you tried to keep the page from caching?
merlin posted this at 07:35 — 16th November 2000.
They have: 410 posts
Joined: Oct 1999
yes, i tried... you know, it's for an intranet inside a firewall and our mother-company saves some data to their server, they shouldn't. (we can't keep the page from caching...)
now we only have the possibility to force a reload to show our staff what changed on our site during the day...
Mark Hensler posted this at 01:14 — 17th November 2000.
He has: 4,048 posts
Joined: Aug 2000
hmmm...
May be you could check for a cookie.
if false, then reload(), and set cookie
if true, then do nothing
then, onUnload() delete cookie
Or.. you could just tell them to refresh their page (shift+refresh will prevent getting a cached page)
Mark Hensler
If there is no answer on Google, then there is no question.
merlin posted this at 08:38 — 17th November 2000.
They have: 410 posts
Joined: Oct 1999
what i was thinking about:
if someone calls the page, there is a 'timer' and every N minutes, the page is reloaded. i know this is doable but ... how?
Suzanne posted this at 08:40 — 17th November 2000.
She has: 5,507 posts
Joined: Feb 2000
Have you tried that?
Suzanne
merlin posted this at 08:45 — 17th November 2000.
They have: 410 posts
Joined: Oct 1999
yup! that's not working... (see above) it's not a workstation-browser-cache-problem. the page is cached somewhere on an intranet-server of our mother-company. and they're not THIS cooperative...
Mark Hensler posted this at 03:47 — 18th November 2000.
He has: 4,048 posts
Joined: Aug 2000
timeout reload...
I didn't mention this before because it can get anoying.
Here's the code:
<html>
<script language=javascript>
<!--
function go() {
setTimeout("location.reload()",500)
}
//-->
</script>
<body onLoad="go()">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<BR>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<BR>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<BR>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<BR>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<BR>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<BR>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<BR>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<BR>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<BR>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<BR>
</body>
</html>
The 500 needs changed to whatever time you want. It's in milliseconds, so right now it refreshes every half a second. Jut watch the page flicker...
quick conversion to minutes, use this:
N*60*1000 = minutes * (60 seconds in a minute) * (1000 milliseconds)
setTimeout("location.reload()",1*60*1000) //every minute
Good Luck,
Mark Hensler
If there is no answer on Google, then there is no question.
merlin posted this at 07:02 — 20th November 2000.
They have: 410 posts
Joined: Oct 1999
that is, what i was looking for! thank you max...
merlin posted this at 12:28 — 20th November 2000.
They have: 410 posts
Joined: Oct 1999
but one following question:
takes this reload only in place when the user let the page on his screen?
or is it the other way round: the user visits the page, goes away for 5 minutes (to another page), we make some changes and when he comes back to our page, it has chaged 5 times (once/minute)? i think i'll try it out on my own...
Vincent Puglia posted this at 16:08 — 21st November 2000.
They have: 634 posts
Joined: Dec 1999
Hi alibababa,
Max's code will refresh as long as the page is active on the user's computer. If the user leaves the page and then returns the cache is used. If you want the newest page to be visible regardless, you will need to set a cookie as Max originally stated along with the meta tags.
When you used the meta tags, did they look like this?
Or, did you only use the pragma? It shouldn't matter where the page is cached. Also, you can tell your users to set the cache preferences in their browsers to no-cache.
Vinny
Where the world once stood
the blades of grass cut me still
merlin posted this at 08:39 — 22nd November 2000.
They have: 410 posts
Joined: Oct 1999
we only used the pragma-one. i added your 'expires' and now it seems to be working...
could you tell me what this tag is doing?
always interested in learning new things,
ali
merlin posted this at 10:43 — 22nd November 2000.
They have: 410 posts
Joined: Oct 1999
now i smell blood! and i'm getting insatiable...
following:
the user has our page on his screen. we make some changes on the page and when we save them, the page is reloaded ON the users screen. without any periodical reload ('setTimeout'). is this doable in an easy way?
but anyway, what i have now is 99% perfect, the rest would be heaven!
Mark Hensler posted this at 01:27 — 23rd November 2000.
He has: 4,048 posts
Joined: Aug 2000
the page cannot be reloaded without any code or actual clicking of 'reload'
Vincent Puglia posted this at 01:15 — 25th November 2000.
They have: 634 posts
Joined: Dec 1999
Hi alibababa,
Essentially, the 'expires' value tells the browser that the page has expired in the 'content' value of time (In the above case '0', or as soon as it is seen. You can put in different values for the content.
I'm a little confused as to the current status of your problem, so if you can expound on the 1% you want.....
Vinny
Where the world once stood
the blades of grass cut me still
merlin posted this at 16:05 — 27th November 2000.
They have: 410 posts
Joined: Oct 1999
hi vinny
well, i can understand that...
i try it once again:
a user has our index.html on his screen for one day. during the day, we as webmasters make some changes on the page. now: right after we save the changes in index.html, the users page is reloaded. this means: there's kind of a signal (or whatever) that sends out the new page after we saved it. so there's no periodical reload in the file and still, the changes will be shown although the user never leaves our index.html.
are you with me? sounds pretty complicated, but in fact, it isn't, believe me!
Vincent Puglia posted this at 17:14 — 27th November 2000.
They have: 634 posts
Joined: Dec 1999
Hi,
I got that part, but is there still a problem? or a wish list?
Vinny
merlin posted this at 06:46 — 28th November 2000.
They have: 410 posts
Joined: Oct 1999
yes: how can i do that?
the above post is a scenario i wish to realize.
well, that's the problem with writing: it makes things much more complicated as they really are... especially, if there's one writing, who isn't this good in english...
myriad posted this at 03:01 — 4th December 2000.
They have: 88 posts
Joined: Mar 1999
hi all,
You can do the above like this:
where 0 is the time in seconds between refresh
and url is the page to reload it can be the same page
or you can direct it to another.
I hope that this is what you wanted or I might have got
the wrong end of the stick.
HTH
steve
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.