I want to be able to tell when a window that I open is closed by the user. This is the code of my attempt at monitoring this:
&l
Try adding after the window loads
document.getElementById('openWindow').onclick = function () {
var windowref = window.open('tests2.html');
windowref.window.onload = function(){ //wait til load to add onunload event
windowref.window.onunload = function () {
window.alert('hola!');
};
}
};
JSBin Example