javascript - Clean-up window.open Variables After User Manually Exits Window -


in app, when user clicks button open window:

mywindow = window.open('http://www.google.com') 

when i'm done processing mywindow, clean-up environment subsequent clicks on same button open new window (if not this, subsequent clicks nothing):

mywindow.close(); delete window.mywindow; 

is possible close remove mywindow environment if user manually exits window? if now, subsequent clicks nothing unless page refreshed.

the "beforeunload" event doesn't appear work when window crosses domains (capture close event of popup window in javascript, javascript detect closing popup loaded domain).

however, appears detect window has been closed user:

if (mywindow.closed) {      delete window.mywindow; } 

wrap in timer (as in second link referenced above), , appears solve problem.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Website Login Issue developed in magento -

Can the constants be defined inside a model file of a framework in PHP? -