In the main window:
var popupWin = null;
function openPopup() {
var url = "popup.htm";
popupWin = open( "", "popupWin", "width=500,height=400" );
if( !popupWin || popupWin.closed || !popupWin.doSomething ) {
popupWin = window.open( url, "popupWin", "width=500,height=400" );
} else {
popupWin.focus();
}
}
function doSomething() {
openPopup();
popupWin.doSomething();
}
In the popup:
self.focus();
function doSomething() {
alert("I'm doing something");
}
http://www.bennadel.com/blog/89-Maintaining-Javascript-Pop-Up-Window-Communication-Across-Window-Opener-Page-Loads.htm
http://www.1pixelout.net/2005/04/19/cross-window-javascript-communication/
http://www.1pixelout.net/2006/12/15/cross-window-javascript-communication-20/
http://www.1pixelout.net/wp-content/downloads/popups20.zip
No comments:
Post a Comment