Reputation: 3822
I did a quick search, but couldn't find a specific solution to this (I'm sure it HAS been answered) but, I need to figure this out...
Anyone know why this won't work in IE?
$(document).ready(function() {
$(document).blur(function() {
window.close();
});
});
And what to do instead? Thanks.
Upvotes: 2
Views: 650
Reputation: 10721
I'm fairly certain that you can't detect a click outside the window itself, which seems to be what you're trying to do.
I would recommend a dialog box instead of a new window if you want it to close. They have nifty features like loading in whole other pages, and even iframes.
Upvotes: 0