How to reload a page after x seconds? client side or server trick?

Hi :slight_smile:

Hopefully the title is quite self explanatory. I’d like to reload a page after x seconds. Is that possible using javascript. I guess yes. Does someone know a place where I could find such a script?

Thanks a lot :slight_smile:

<script language="JavaScript" type="text/javascript">
setTimeout("location.href = 'redirect_here.html'",10000); // milliseconds, so 10 seconds = 10000ms

Note that this script should be in the redirect_here.html too, if you wish to keep on reloading.
However, you can also do this with pure html. Like this:

<meta http-equiv="refresh" content="10; url=redirect_here.html">

(the first parameter of the content-attribute means the time in seconds)
Put it between the starting/ending head tags.

thanks a lot for your reply :slight_smile:

I really appreciate it.

Is there a way to display the countdopwn on the page?

Somthing like this?

<script type="text/javascript">
var timer=0;
function startTimer()

function timerUp()
        var resetat=180; //change this number to adjust the length of time in seconds
	var tleft=resetat-timer;
<body onload="startTimer()">
Seconds until page reloads:
<div id="timer">

Currently it is set to refresh after 3 minutes, note the 180 seconds

That should be



That’s what’s there. . . .?? [edit]Ahh, I see, it’s a comma, sry typo. Fixed.[/edit]