File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes message/close window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "message/close window" Watch "message/close window" New topic

message/close window

Claudia Vaz
Ranch Hand

Joined: Nov 13, 2001
Posts: 44
How cani disable the security message that appears when i do a window.close();
Claudia Vaz
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Apparently you can only use window.close() to close windows that were originally opened by JavaScript to restrict the control that scripts have over the browser.
Therefore you don't actually disable the security, you organise it so the security is not a problem.
If you open a new window (window2) from an existing window (window1) then window2 should be able to call close() on itself and window1 should be able to call close on window2, but there is no guarentee that window1 will be able to call close() on itself.
I agree. Here's the link:
subject: message/close window
It's not a secret anymore!