The name of the given link is key. if the window was opened with javascript,
window.close() will work fine (so your popups, etc., will close just fine.
if the window wasn't opened with javascript, it's a security issue, and as
previously said, most modern browsers don't allow it.

Example:
http://beauscott.com/examples/jswindows/

Click the popup button (opens a window with window.open(...)), you'll be
directed to win.htm in a popup, which you can close with
javascript:window.close().

However, if you go to
http://beauscott.com/examples/jswindows/win.htmdirectly and try to
press close, nothing will happen.

Hope that helps.

Beau



On Mon, Feb 23, 2009 at 8:16 PM, Wade Preston Shearer <
[email protected]> wrote:

> On 23 Feb 2009, at 19:34, Scott Hill wrote:
>
>  I want to have a button that I can click that will close the window (or
>> tab).  I have tried document.close, window.close, and this.close.  None
>> seems to work.  Any ideas on how to do this.  Right now I am using Firefox
>> but I need it to work on IE as well.
>>
>
> Give this a try:
>
>
> http://www.gtalbot.org/BrowserBugsSection/MSIE6Bugs/ClosingWindowsNotOpenedByJS.html
>
>
>
> _______________________________________________
>
> UPHPU mailing list
> [email protected]
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
>



-- 
Beau D. Scott
Software Engineer

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to