Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2003
    Location
    Bournemouth
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry open a new page in the same window using JavaScript

    Hi, im having a bit of trouble with some javascript coding.

    I have an index page with 3 frames, on my main frame I got a sort of password, user group thing going on.
    When you type your user group you get directed to your usergroup page.
    the problem is this new page opens up in a new window, where I want it to open up in the frame from window it was in, if that makes any sense.

    ive used the code to this.

    window.open("newpage.htm")

    I was wondering if anyone new what code I should put instead of this to open up the new page but in the same window and in the same frame.

    Thanks.

  • #2
    New Coder
    Join Date
    Jan 2003
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Suppose you want frame 3 to be loaded (replaced) with the new URL...

    Code:
    top.frames[2].location = "new.html";

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you want to open the page in the same frame where he already was, just use

    self.location="newpage.htm"
    Don't resist to assimilation. Billions of Borgs can't be wrong!


  •  

    Posting Permissions

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