Toccoa wrote :
I doubt this; you obviously did not search this newsgroup's past posted
messages on window.close().
- I mean searching with Google(r) - I
Open up a browser window and then look at the top right corner of the
window, on the titlebar. What do you see? Do you see a link or do you
see a command system button? Why should a link be able to close a
window? Isn't the default and normal action of a link to load a new
webpage (to replace current webpage with a new webpage) into the current
browser window?
Now, please tell me what's wrong with that "X" icon button on that
titlebar?
Why do you need to duplicate it with javascript? What's wrong with
default basic standard interface of a browser window? Why do you want to
control the user's browser window to the point that he will have to use
your javascript-dependent widget instead of his standard default close
button in the titlebar?
If you need an extra button, then ask yourself why an user would or
should prefer+trust your javascript-driven button to his browser window
basic standard close button.
Now, why can't you duplicate with javascript the Refresh button too? Why
not? And then the Back button. Why not duplicate the Forward button too?
Then the resize/restore button. And the minimize button.
'Invoking the window.close method on a window not opened with script
displays a confirmation dialog box. Using script to close the last
running instance of Microsoft Internet Explorer also opens the
confirmation dialog box.'
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/close_0.asp?frame=true
I personally asked myself Microsoft to fix that bug in channel9 feedback
webpage
http://channel9.msdn.com/wiki/default.aspx/Channel9.InternetExplorerSecurity
http://www.gtalbot.org/BrowserBugsSection/MSIE6Bugs/ClosingWindowsNotOpenedByJS.html
and to fix it for good in IE7. Leave IE7 windows alone! If web authors
should not abuse opening of window via script (unrequested
javascript-initiated opening of secondary window, popups), then they
shouldn't be able to close windows via script. It also has been the
perspective of Microsoft to warn users about script trying to close
their window so that they can grant or decline such actions so that they
would not lose history of visited urls.
and no change in FF2. Is that correct or did I do something
A javascript-initiated window can be closed by close(); other windows
can not be by forced closed by javascript with close().
http://kb.mozillazine.org/About:config_entries#DOM..2A
Stop coding links or buttons to close a window. Start accepting that you
are not the user. (S)He does not need your scripts to close his/her
browser windows.