Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Open() Method


Message #1 by Terrence Joubert <Terrence@v...> on Mon, 30 Sep 2002 14:08:06 +0400
Hi Terrence,

The following function shows an example of this:


var myNewWindow;
function openNewWindow()
{
    var myWidgets 
    'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=300,height=200'    myNewWindow =
window.open ('myNewPage.html', 'aNewWindow', myWidgets);
    myNewWindow.focus();
    myNewWindow.moveTo(((screen.width/2) - 150), ((screen.height/2) - 100));
}

The variable myNewWindow holds a reference to the new window.

HtH

Imar



> Hi,
>
> I have the main browser window (refer to it as WinA) that is showing an
> HTML document.
> I want to use JavaScript in this document to open a new Window (WinB)
> and maintain a reference to WinB from within my code in WinA.
>
> How can I go about doing that in JavaScript? I thought about using the
> Window.Open() method, the window opens fine, but I can't maintain a
> reference to it.
>
> Any help will be very much appreciated.
>
> Thanks
> Terrence
>
>




  Return to Index