Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes windows.close() stopped working. Why? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "windows.close() stopped working. Why?" Watch "windows.close() stopped working. Why?" New topic
Author

windows.close() stopped working. Why?

Darrin Smith
Ranch Hand

Joined: Aug 04, 2003
Posts: 276
I call windows.close() when the user clicks a button to close the browser. This works just great until my web page is embedded in a frame. Once that happens, the code gets called, but the browser does not close (no message is displayed warning me about the close either).

Is there a way to close the browser from within a frame?

Thanks.
Darrin Smith
Ranch Hand

Joined: Aug 04, 2003
Posts: 276
Hold on...found something: http://www.codelifter.com/main/tips/tip_017.shtml

I'll give that a try.
Darrin Smith
Ranch Hand

Joined: Aug 04, 2003
Posts: 276
Yup...that did it.

Instead of window.close() you need to call top.window.close().
 
Consider Paul's rocket mass heater.
 
subject: windows.close() stopped working. Why?
 
Similar Threads
Frame set visible
Browser window and applet frame
detaching an applet from a browser
Frame shrinks on some machines
closing !!