Timed Redirect Overview
The above code redirects from the page it is on to www.example.com after a delay of 5000 milliseconds (5 seconds) - change the https://www.example.com to your destination URL and the 5000 to the number of milliseconds you want to delay for. To change seconds into milliseconds it is simply a case of multiplying by 1000.
An example of the time redirect can be seen by clicking the following link:
Using A Function In The Timed Redirect
In order to use a function to implement your timed redirect you will need to place the code for the function inside the HEAD tags and then the code that calls the function inside the BODY tags.
The code for the function is as follows:
In the body you place the call to the function, this can be an onLoad on the BODY tag or an onClick on a button or on one of the many event handlers that can be implemented in a web page
<body onLoad="setTimeout('mytimer()',10000);"> <p>You will be redirected in 10 seconds</p> </body>