Here is a working example. (The only difference between what I'm doing and what you are doing is I'm using a text link vs. a button for the close option).
Original page that opens the alert box:
http://housesunlimitedinc.com/cgi-bin/subscribeform.asp
<a href="#" onClick="window.close();">Close this window</a>
Revised page that works without bringing up the alert box:
http://housesunlimitedinc.com/cgi-bin/closetest.asp
<a href="#" onclick="window.opener=null; window.close(); return false">Close This Window</a>
As you can see it's the same code as I posted above, and works perfectly on MSIE 6.0; Netscape 7.0 does not show the alert box by either method; This did not work in Netscape 4.78 (surprise, surprise) - and I don't have the patience to try to come up with workarounds for Netscape 4.x anymore. If someone is still using that old browser, then they are just going to have to live with the way it displays pages and handles more current code.
Added note:
Copy and paste the links into your browser to see the alert box pop-up in the original page. Apparently, when clicking on them here, there is no alert box on the simple version of onClick. Steen explained why in the original thread:
Apparently you can avoid the alert
if there is only one location in the window's history, so if you open a
child window and close it from within the child window, there is no
message.
It's a Microsoft Security thing!
This problem is not an issue when doing HTA's (applications)
as in:
Invoking the window.close method on an HTA closes the application without prompting the user because the HTA is trusted and follows a different security model.
but in the broswers, it's not the same.
http://msdn.microsoft.com/library/defau ... lose_0.asp
To this date, this is still a *peach* up issue.
I've read comments on flushing out the history before going
to a child window but I'll be damned it I can find a sample anywhere.
sorry ...
Perhaps the Microsoft link he included in the original post gives added insight.
Thanx .... I have upgraded IE to 6.0 and now its working fine. :)