dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: a sample javascript question?help me

  1. #1
    Join Date
    Nov 2002
    Posts
    4

    a sample javascript question?help me

    Hi Friends,

    I just learn javascript.I have a sample here

    http://24.112.27.16/page1.html

    the page 2 window open when I click open page 2 in page 1.
    and page 3 window open when I click open page 3 in page 2.

    now I need a feature.I need the page 3 take place page 1 when I click open page 3 in page 2.and also the page2 close.

    Please show me how to do it.Thanks so much.

    I confuse to use window.location now.

  2. #2
    Join Date
    Nov 2002
    Posts
    421
    OK, I am confused -

    but if you want to replace a page (have one page replace another in its place) use

    self.location.replace("xxxx.htm")

  3. #3
    Join Date
    Nov 2002
    Posts
    12

    Re: a sample javascript question?help me

    Originally posted by mshen
    Hi Friends,

    I just learn javascript.I have a sample here

    http://24.112.27.16/page1.html

    the page 2 window open when I click open page 2 in page 1.
    and page 3 window open when I click open page 3 in page 2.

    now I need a feature.I need the page 3 take place page 1 when I click open page 3 in page 2.and also the page2 close.

    Please show me how to do it.Thanks so much.

    I confuse to use window.location now.
    Okay you want:
    Page 1:
    click "open page 2" to open it in a new window
    Page 2:
    click "open page 3" to open page 3 in Page 1's window and close Page 2's window.

    I am rusty on the use of parent and self, but this MIGHT be how you could do that.

    when the user clicks the "open page 3" button on page 2, try using:
    parent.location.replace("page3.html") OR parent.location="page3.html"
    AND
    self.close()

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles