DOM - Handling Windows

Results 1 to 5 of 5

Thread: DOM - Handling Windows

  1. #1
    smallChick Guest

    Default DOM - Handling Windows

    I&#039ve used a WindowOpener Function to open a new instance of a Window called "Child".<BR><BR>When the user clicks a button to close "Child" I want the following things to occur:<BR><BR>i: Test to see if the Window that opened "Child" is still open.<BR>ii: If it is open return the focus to it.<BR>iii:Close "Child"<BR><BR>My problem is I don&#039t know how to reference the "Parent" Window.<BR><BR>Can someone please point me in the right direction?<BR><BR>Thanks.

  2. #2
    John T Guest

    Default RE: DOM - Handling Windows

    label the parent before leaving it - see following<BR><BR>"spamone";<BR><BR>8-)

  3. #3
    smallChick Guest

    Default Still not working

    Here are my 2 functions:<BR><BR>THIS FUNCTION OPENS THE NEW WINDOW CALLED WINDOW2<BR>-------------------------------------------------<BR>function WindowOpener(){<BR>"Parent";<BR>v ar new_window ="child.htm", "Window2", "height=400, width=400, status, resizeable=&#039false&#039");<BR>}<BR>&#060;/script&#062;<BR><BR>NOW I WANT TO RETURN THE FOCUS TO THE MAIN WINDOW FROM THE CHILD<BR>----------------------------------------------------------------<BR>&#060;script language="JavaScript";&#062;<BR>function FocusMain(){<BR>Window.Parent.Focus();<BR>}<BR>&#0 60;/script&#062;<BR><BR>But I get a message saying that Parent is undefined.<BR><BR>

  4. #4
    jason Guest

    Default RE: Still not working

    you were misinformed. you need to use the window.opener property.<BR><BR>jason<BR>

  5. #5
    smallChick Guest

    Default Thanks

    Thanks Jason, Script now running as anticipated.

Posting Permissions

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