• Redirecting To A Different Page Using JavaScrip

    Date: 2011.02.24 | Category: Scripts | Tags:

    There are times when a simple JavaScript redirection from one page to another can come in handy and, the following JavaScripting will enable you to do this.

    When a page contains this javascript, it will be redirected to another page that you specify in the “window.location=”. You can change the number of refresh seconds by changing the “move()’,1000 to the number of seconds you’d like.

    Example:

    1000 = 1 second
    2000 = 2 seconds
    3000 = 3 seconds

    Place this JavaScript code between the <head> and </head> tags

    <script language=”JavaScript”>
    <!–hide from old browsers
    var time = null
    function move() {
    window.location = ‘http://www.yourdomain.com’
    }
    //–>
    </script>

    Place this JavaScript code in your <body> tag

    <body onload=”timer=setTimeout(‘move()’,1000)”>

    You should now have a page that will redirect to a new url when it loads in the surfers browser window.

    Article written by Lee