I have a form that redirects to a site if its online or print error message if its online.
Now I want to delay and redirect to the site whether offline or online after 5 seconds elapse.
I have added setTimeout() but it does not delay for 5 minutes before redirecting to another site.
Any help
on the body, i have onload() eventCode:<script type="text/javascript"> //start checking onlineconnection status function checkconnection() { var status = navigator.onLine; if (status) { window.onload=timeout; function timeout(){ window.setTimeout("redirect()",5000)} window.location="www.online.com" } else { window.location="www.offline.com" } } </script>
Any HelpCode:<body onload="checkconnection();">



Reply With Quote



Bookmarks