function redir(){
setTimeout(window.location = '/SV/main/main.html', 10);
}
I dont know if the delay is in miliseconds or seconds, but I have tried BOTH. (by adding three zeros).
Problem is, the redirect is made right away, without any delay at all... why?
Thanks
BTW its called like this: <body onload="redir();">
You have to put your javascript statement between quotes :
function redir(){
setTimeout("window.location = '/SV/main/main.html';", 10);
}
The delay is in milliseconds btw.
As said in the comments and other answers, it is much cleaner to use an anonymous function to do such things :
function redir() {
setTimeout(function(){
window.location = "/SV/main/main.html";
}, 10); // 10 milliseconds
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With