Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    var openedWindow = []
  2.             var sis
  3.             //16 Backoffice,21 parametria,34 archivo plano pagador,35 archivo plano proveedor
  4.             function openWindow(url,pagina,sis) {
  5.                 if (url != openedWindow) {
  6.  
  7.                     if (sis == 16) {
  8.                         openedWindow[0] = window.open(url, pagina);
  9.                     }
  10.                     if (sis == 21) {
  11.                         openedWindow[1] = window.open(url, pagina);
  12.                     }
  13.                     if (sis == 34) {
  14.                         openedWindow[2] = window.open(url, pagina);
  15.                     }
  16.                     if (sis == 35) {
  17.                         openedWindow[3] = window.open(url, pagina);
  18.                     }
  19.                 }
  20.             }
  21.  
  22.             function closeOpenedWindow(ws) {
  23.                 if (openedWindow[0] == null || openedWindow[1] == null || openedWindow[2] == null || openedWindow[3] == null) {
  24.                     console.log("no hay una pestaña abierta");
  25.                     return true
  26.                     //openedWindow.close();
  27.                 } else if (window.openedWindow.window == null) {                    
  28.                     console.log("no hay una pestaña abierta");
  29.                     return true
  30.                 } else {                    
  31.                     alert("existe una pestaña abierta");
  32.                     return false;
  33.                 }                
  34.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement