JS: open multiple popUps


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. popupWins = new Array();
  2.  
  3. function windowOpener(url, name, args) {
  4. /*******************************
  5. the popupWins array stores an object reference for
  6. each separate window that is called, based upon
  7. the name attribute that is supplied as an argument
  8. *******************************/
  9. if ( typeof( popupWins[name] ) != "object" ){
  10. popupWins[name] = window.open(url,name,args);
  11. } else {
  12. if (!popupWins[name].closed){
  13. popupWins[name].location.href = url;
  14. } else {
  15. popupWins[name] = window.open(url, name,args);
  16. }
  17. }
  18.  
  19. popupWins[name].focus();
  20. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.