Return to Snippet

Revision: 31269
at September 2, 2010 04:17 by magicrebirth


Updated Code
popupWins = new Array();

function windowOpener(url, name, args) {
/******************************* 
the popupWins array stores an object reference for
each separate window that is called, based upon
the name attribute that is supplied as an argument
*******************************/
	if ( typeof( popupWins[name] ) != "object" ){
		popupWins[name] = window.open(url,name,args);
	} else {
		if (!popupWins[name].closed){
			popupWins[name].location.href = url;
		} else {
			popupWins[name] = window.open(url, name,args);
		}
	}

	popupWins[name].focus();
}

Revision: 31268
at September 2, 2010 04:16 by magicrebirth


Initial Code
popupWins = new Array();

function windowOpener(url, name, args) {
/******************************* 
the popupWins array stores an object reference for
each separate window that is called, based upon
the name attribute that is supplied as an argument
*******************************/
	if ( typeof( popupWins[name] ) != "object" ){
		popupWins[name] = window.open(url,name,args);
	} else {
		if (!popupWins[name].closed){
			popupWins[name].location.href = url;
		} else {
			popupWins[name] = window.open(url, name,args);
		}
	}

	popupWins[name].focus();
}

Initial URL
http://www.codestore.net/store.nsf/unid/DOMM-4PYJ3S

Initial Description


Initial Title
JS: open multiple popUps

Initial Tags
textmate, window

Initial Language
JavaScript