$(function(){
var count = 5;
countdown = setInterval(function(){
$(".countdown").html("Closing in " + count + "...");
if (count == 0) {
window.close();
}
count--;
}, 1000);
});
Doesn’t seem to be working for me. But if I change window.close(); to window.location = "http://google.com";, it works. Any help on closing a window after a countdown would be a great help!
Thank you!
In which browser are you trying this ? Usually it is not that simple when working in browsers that have multiple tabs opened .. I used the below for opening and closing a window (single tab) and it worked for me