clear jQuery array after click -


i modified jquery script show customized layer instead of modal when clicking on external links. have link sitting in array until user clicks "ok" or "cancel" , gets redirected. problem happens if click link on page, every external link clicked on loads in separate tabs. being said, can't figure out how clear array after clicking "ok" or "cancel".

$('a[href^="http"]').not('a[href^="{{ shop.url }}"]').click(function(e) {     var external = $(this).attr('href');     e.preventdefault();      $('#leaving').toggle('slow');      $('#linkgo').click(function() {         $('#leaving').fadeout(500);         window.open(window.open.location = external);     });      $('#linkcancel').click(function() {         $('#leaving').fadeout(500);     }); }); 

so...i found workaround. once specified window name (not "_blank") window.open command worked fine. if there's different (or better) fix let me know.

$('#linkgo').click(function() {     $('#leaving').fadeout(500);     window.open(window.open.location = external , "windowname"); }); 

Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -