bfeddish
asked on
Refreshing the browser window
I have a regular ASP page (not ASP.NET) and I wan't to continuously refresh the page without having to hit a submit button or anything. I need something like the timer in ASP. NET.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There's really no point in using setInterval though, as the interval clears when the page reloads.
The most compatible way of doing it would be something like this;
<script language="JavaScript" type="text/javascript">
<!--
setTimeout('document.locat ion.assign (location. href)',500 0);
//-->
</script>
That one is supported by all JavaScript enabled browsers.
5000 is the time in milliseconds before the action is triggered; 5 seconds.
If you still prefer setInterval this will be enough;
<script language="JavaScript1.2" type="text/javascript">
<!--
setInterval('document.loca tion.reloa d()',5000) ;
//-->
</script>
FYI ;)
The most compatible way of doing it would be something like this;
<script language="JavaScript" type="text/javascript">
<!--
setTimeout('document.locat
//-->
</script>
That one is supported by all JavaScript enabled browsers.
5000 is the time in milliseconds before the action is triggered; 5 seconds.
If you still prefer setInterval this will be enough;
<script language="JavaScript1.2" type="text/javascript">
<!--
setInterval('document.loca
//-->
</script>
FYI ;)
ASKER
I liked Nighman's the best but the others look useful too. I upped the points and split them for everybody.
Thanks!