Open new file in current window

Discussion in 'Javascript' started by Richard A. Melia, Apr 16, 2004.

  1. I have a window open, let's say index.html.
    On the page I have a link that executes a javascript.
    I want the javascript to open file new.html in the same window that
    index.html was displayed in.
    How do I do this?
    Everything I try opens a new window.

    I appreciate any help you can offer.
    Thanks!
    Richard A. Melia, Apr 16, 2004
    #1
    1. Advertising

  2. Richard A. Melia

    Randy Webb Guest

    Richard A. Melia wrote:

    > I have a window open, let's say index.html.
    > On the page I have a link that executes a javascript.
    > I want the javascript to open file new.html in the same window that
    > index.html was displayed in.
    > How do I do this?
    > Everything I try opens a new window.
    >
    > I appreciate any help you can offer.
    > Thanks!
    >
    >


    document.location.href = "new.html";

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/
    Randy Webb, Apr 16, 2004
    #2
    1. Advertising

  3. Thanks, Randy.
    You are a savior!

    "Randy Webb" <> wrote in message
    news:p...
    > Richard A. Melia wrote:
    >
    > > I have a window open, let's say index.html.
    > > On the page I have a link that executes a javascript.
    > > I want the javascript to open file new.html in the same window that
    > > index.html was displayed in.
    > > How do I do this?
    > > Everything I try opens a new window.
    > >
    > > I appreciate any help you can offer.
    > > Thanks!
    > >
    > >

    >
    > document.location.href = "new.html";
    >
    > --
    > Randy
    > Chance Favors The Prepared Mind
    > comp.lang.javascript FAQ - http://jibbering.com/faq/
    Richard A. Melia, Apr 16, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gordon
    Replies:
    3
    Views:
    286
    Steven Burn
    Apr 16, 2004
  2. Paul
    Replies:
    2
    Views:
    169
    Thomas 'PointedEars' Lahn
    Oct 19, 2003
  3. PC HUA
    Replies:
    2
    Views:
    392
    PC HUA
    May 19, 2004
  4. Replies:
    7
    Views:
    205
    Henry
    Sep 25, 2007
  5. Replies:
    1
    Views:
    224
Loading...

Share This Page