|
I have a similar problem
//Initialize, attach the pop-up window object to the global variable
//var timer;
var attach;
function initWin(obj){
attach = obj;
attach.focus();
//Set the time to execute the function regularly
timer=window.setInterval("IfWindowClosed()",500);
}
//Judge whether the window is closed
function IfWindowClosed() {
//alert();//If you run the alert, the following sentence will not prompt you without permission, you can run normally
if (attach.closed) {//This sentence prompts no permission
window.location=window.location;
window.clearInterval(timer);
attach = null;
}
} |
|