|
Q345 How can I make a generic function that opens up windows using the url, window name that I pass, which correctly defines the opener as the current window?
irt.org | Knowledge Base | JavaScript | Window | Q345 [ previous next ]
Q345 How can I make a generic function that opens up windows using the url, window name that I pass, which correctly defines the opener as the current window?
Try this:
<SCRIPT LANGUAGE="JavaScript"><!--
function myopen(url,name,parms) {
var handle = window.open(url,name,parms);
if (!handle.opener) handle.opener = self;
return handle;
}
var window1 = window.myopen('http://www.irt.org/','windowName1','width=400,height=400');
var window2 = window.myopen('http://www.netscape.com/','windowName2','width=400,height=400');
var window3 = window.myopen('http://www.microsoft.com/','windowName3','width=400,height=400');
//--></SCRIPT>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.