Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

windows.close() stopped working. Why?

 
Darrin Smith
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hold on...found something: http://www.codelifter.com/main/tips/tip_017.shtml

I'll give that a try.
 
Darrin Smith
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup...that did it.

Instead of window.close() you need to call top.window.close().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic