Results 1 to 4 of 4

Thread: Redirection In Javascript

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341
    Is it possible to make it so when a page loads on the net it redirects to another page in java script, if so how ?

    If this cannot be done then how do i open a new window at a certain address ?

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    hi PsyVision

    you need to use the window.location function

    <HTML>
    <script language="javascript">
    function redirectbrowser()
    {
    window.location = "somepage or url"
    }
    </SCRIPT>

    <BODY onload="redirectbrowser();">
    </BODY>
    </HTML>

    Hope this helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    You don't need javascript for that, you can use this:
    Code:
    <HTML>
    <HEAD><TITLE>Redirecting</title>
    <meta http-equiv="Refresh" content="1; URL=http://www.altavista.com">
    </HEAD>
    </HTML>
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341

    Thanks.....

    But...

    A short while after writing this post i scripted my own at last. I tried the second way but it never opened the new page i wanted, just refreahed the browser. What i did is bascially the same as 'Ianpbaker' did it.

    Thanks Again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width