Posted By

magicrebirth on 09/02/10


Tagged

textmate window popup


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

lanabear


JS: open multiple popUps


 / Published in: JavaScript
 

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

  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. }

Report this snippet  

You need to login to post a comment.