unfortunately, I can't find any mention of this anywhere. I'm still
looking...
I think the correct behavior should be, if my script created the window,
then my script should be able to check if it's closed, regardless of
what is being displayed in it at the time.
Mozilla used to have this same bug, and they fixed it to let .closed be
visible to any code, regardless of security.
It's all a metter of personal preferences. I've disliked every version
of Opera I've tried, and I've liked IE since version 5. I've been
testing and using browsers since mosaic came out, and I think IE6 is the
best of any one I've seen
Matt
Hi Matt
I am no expert here, just learning the language but remember an exercise I
did in my book on this subject. Here is the full code of the exercise, it
creates a window then takes care of all browsers and how to check if the
window has been closed by either the code or the user, if the window has
been closed it will open the same window then close it again, then there
are no errors. Take a look it might help, you might be able to adapt some
of it to your advantage.
Hope it helps
DaveG
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"> <HTML>
<HEAD>
<TITLE>window.closed Property</TITLE> <SCRIPT LANGUAGE="JavaScript">
// initialise global var for new window object // so it can be accessed
by all funtions on the page. var newWind
// set flag to help out with special handling for window closing var
isIE3 = (navigator.appVersion.indexOf("MSIE 3") != -1) ? true : false
// make new window and put some stuff in it. function newWindow() {
var output = ""
newWind = window.open("", "subwindow", "HEIGHT=200, WIDTH=200")
// taking care of navigator 2
if (newWind.opener == null) {
newWind.openern = window
}
}
output += "<HTML><BODY><H1>A sub-window</H1>" output += "<FORM><INPUT
TYPE='button' VALUE='Close Main Window'
onClick='window.opener.close()'></FORM></BODY></HTML>"
newWind.document.write(output)
newWind.document.close()
}
// close subwindow, including ugly workaround for IE3 function
closeWindow() {
if (isIE3) {
// if window is already open, nothing appears to happen // but if not,
the subwndow flashes momentarily (ahhh) newWind = window.open("",
"subwindow", "HEIGHT=200, WIDTH=200")
}
if (newWind && !newWind.closed) {
newWind.close()
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" VALUE="Open Window" onClick="newWindow()"><BR>
<INPUT TYPE="button" VALUE="Close it if still open"
onClick="closeWindow()">
</FORM>
</BODY>
</HTML>