Skip to content

Instantly share code, notes, and snippets.

@lambdamusic
Last active April 4, 2024 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lambdamusic/4734348 to your computer and use it in GitHub Desktop.
Save lambdamusic/4734348 to your computer and use it in GitHub Desktop.
JavaScript: JS: open multiple popUps #js
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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment