JavaScript

Redirect Page Using After 5 Seconds Javascript Examples

You can redirect page using JavaScript with  just 1 line of code. You also have the option of redirecting immediately or redirect after 5 seconds. Read on to find out more on how to do this.

How to Redirect Page using JavaScript – Examples

Example 1: Redirect without any delay using JavaScript

<script language="javascript">
window.location.href = "http://www.theextremewebdesigns.com";
</script>

Example 2: Redirect Page after 5 seconds using JavaScript

If you want to redirect page using JavaScript after 5 seconds, use the following code:

<script language="javascript">
setTimeout("top.location.href = 'http://www.theextremewebdesigns.com/'",5000);
</script>
That’s it!

Do you know of any other ways to redirect page using javascript? Please feel free to share by commenting below.

One Comment on Redirect Page Using After 5 Seconds Javascript Examples

  1. 1

    Nice share! I created an advanced Javascript Rediretion Script Tool to generate scripts. This also uses the location.replace() method, and an IE referrer pass hack. rel=”canonical” also suppoted.

    http://online-marketing-technologies.com/tools/javascript-redirection-generator.html

Share your thoughts, comment below now!

*

*