Last active
April 4, 2024 22:05
-
-
Save lambdamusic/4734348 to your computer and use it in GitHub Desktop.
JavaScript: JS: open multiple popUps #js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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