[this page | pdf | back links]
BOM window object) returns
true if the window has been
closed or false if it has not been closed. If the window doesn’t exist (e.g.
because it was never opened) then this can be tested for by e.g. evaluating (!windowvar)
as this will evaluate to false if windowvar does not exist.
HTML USED IN THIS EXAMPLE:
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
Window default closed: <b id="element"></b><br>
var x = window.closed;
document.getElementById("element").innerHTML = x;