How to use JavaScript for the timed redirect on the client-side. Here's an example of how you can do it:

 

  <h1>Redirecting in 5 seconds...</h1>

  <script>

    // Set the desired delay time in milliseconds

    var delayInMilliseconds = 5000; // 5 seconds

 

    // Function to perform the redirect after the specified delay

    setTimeout(function () {

      window.location.href = "https://example.com/new-page.php";

    }, delayInMilliseconds);

  </script>

 

In this example, the HTML page contains a simple message indicating that the redirect will happen in 5 seconds. The JavaScript setTimeout() function is used to set a timer, and after the specified delay (in milliseconds), it triggers the redirection to the desired URL using window.location.href.

Using JavaScript for timed redirects is a more efficient and standard approach, as it does not block the server's resources and provides better control over the timing on the client-side.