I have code to check if a window is closed. It works IF I stay on the same page.
With Internet Explorer, if I click on a link that then redirects to another site, that window.closed returns true even though the WINDOW never actually is closed.
I am doing this:
w = window.open("mypage.html"); var t = setInterval(function() { if (!w) { alert('a'); } if (w.closed) { alert('b'); } if (!w || w.closed) { clearInterval(t); hide('mainShadow'); } }, 800); Within "mypage.html", there is a link to another site. When going to that other side, the w.closed returns true.
Is there a good way in IE to really check if the window is closed or not.
The contract isn't really satisfied because the window never actually closed.
This code works in Chrome, not in IE9
clearInterval. But anyway good question.