I would like to close a child window I opened from the parent using setTimout. I have tried these functions below, i succeed to open the window, but failed in closing it using the setTimeout function:
function 1
function 2
function 1
Code:
var sendWin;
function sendWindow() {
sendWin = window.open("http://www.google.fr");
setTimeout("if (sendWin && !senWin.closed) sendWin.close()", 10000);
}
function 2
Code:
function sendWindow() {
var sendWin = window.open("http://www.google.fr");
setTimeout(function() {
if (sendWin && !senWin.closed) sendWin.close();
}, 10000);
}
Comment