The tab opens this way:
window.open('/pay_wm?points='+$('#cpoints').val()+'', '', 'menubar=yes, location=yes, resizable=yes, scrollbars=yes, status=yes');
I need to somehow check if it is closed, then deduce alert(1)
, for example. How to do it?
The tab opens this way:
window.open('/pay_wm?points='+$('#cpoints').val()+'', '', 'menubar=yes, location=yes, resizable=yes, scrollbars=yes, status=yes');
I need to somehow check if it is closed, then deduce alert(1)
, for example. How to do it?
I myself answer my question. Who cares:
var new_window = window.open(...); var new_interval = setInterval(function() { if(new_window.closed) { alert(1); clearInterval(new_interval); } }, 100);
If I understand you correctly, then you need to hang the handler on the unload event
Source: https://ru.stackoverflow.com/questions/168961/