FAQ Topic - How do I close a window and why does it not work on the first one? (2008-04-29)



-----------------------------------------------------------------------
FAQ Topic - How do I close a window and why does it not
work on the first one?
-----------------------------------------------------------------------

Use ` windowRef.close() `, where windowRef is a window object
reference, such as window, top, parent, self, or a reference
obtained from the window.open() method. You can only close
windows opened by scripts, no others.

http://msdn2.microsoft.com/en-us/library/ms536367.aspx

http://docs.sun.com/source/816-6408-10/window.htm#1201822

http://developer.mozilla.org/en/docs/DOM:window.open#FAQ


--
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers. The sendings of these
daily posts are proficiently hosted by http://www.pair.com.

.



Relevant Pages

  • Re: FAQ Topic - How do I close a window and why does it not work on the first one?
    ... Wait another 5 years and the FAQ probably still won't be changed to include any way to annoy users by closing windows. ... Any script that can close a window that script didn't open is exploiting a security flaw :-) ... The way a browser tells whether a script opened the window was by checking the window.opener property. ...
    (comp.lang.javascript)
  • Re: FAQ Topic - How do I close a window and why does it not work on the first one?
    ... Wait another 5 years and the FAQ probably still won't be changed to include any way to annoy users by closing windows. ... Any script that can close a window that script didn't open is exploiting a security flaw :-) ... The way a browser tells whether a script opened the window was by checking the window.opener property. ...
    (comp.lang.javascript)
  • Re: FAQ Topic - How do I open a new window with javascript?
    ... FAQ Topic - How do I open a new window with javascript? ... I would think that, by nature, a FAQ entry should address only one topic. ... It is my understanding that opening a window, accessing some other document and modifying a document structure are three different matters, identified as such in the current version of the FAQ. ... A recent questioner seemed to want to have a new window containing in part standard text and in part customised text, for which the quoted code could be used. ...
    (comp.lang.javascript)
  • Re: FAQ Topic - How do I open a new window with javascript?
    ... However one would never use wRef.document.body.innerHTML to write to an *empty* window! ... Rather, one would employ the "javascript:" pseudo-protocol, or the simple document.open, document.writeand document.closestatements. ... It seems to me that this is already what the FAQ is doing, by splitting entries into very small units, and providing links to external resources for further analysis by the reader. ... However, I suppose that only empirical analysis could stress the validity of the current model, though it might simply demonstrate that some FAQ entries are now outdated, and that some new ones might just need to be added. ...
    (comp.lang.javascript)
  • Automation of comp.lang.javascript FAQ
    ... I'm proposing my plan to automate the comp.lang.javascript FAQ ... Internationalisation in javascript. ... How do I find the size of a browser window? ... How do I close a window and why does it not work ...
    (comp.lang.javascript)