When you create a new window using window.open()
, it returns a handle to the (theoretically) opened window. You can then test that handle to determine whether the window is open:
var child = window.open("mypopup.html");
// some popup blockers prevent the window from being created (!child) and
// others just close them before they're displayed (child.closed)
if (!child || child.closed) {
// tell the user to turn off their popup blocker
}
Popups are very intrusive, however, and you should consider trying to display the "popup" information within the page. In particular, have a look at "dialog" scripts. If you're using jQuery, a very nice Dialog widget is included in the jQuery UI library.