Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counter without setTimeout

Status
Not open for further replies.

DigitalBoy

Programmer
Oct 11, 2000
87
US
I am trying to develop a counter that will do a self.location after 8 seconds. However, I cannot use setTimeout because the browser that I'm developing for will not accept it. I can only use the Date functions. Any suggestions?

- DB

dgtlby@excite.com
Administrator

UBB Developers Network

 
you can use this:

function sleep(num)
{
var f = new Date();
f = new Number(f);
f = f + num;
while(true)
{
var n = new Date();
n = new Number(n);
if(n >= f)
{
break;
}
}
}

you just call it like so:

sleep(8000);
then call your function. luciddream@subdimension.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top