[thelist] Javascript:self.close() w/out Warning

Martyn Haigh martyn.haigh at virgincosmetics.com
Thu Jan 30 09:14:04 CST 2003


Does this work in all browsers?

I think I remember reading somewhere that this was an IE only thing...I
could be wrong.  Anyone know?

M

Martyn Haigh

Site Developer
The Virgin Cosmetics Company
City Fields, Chichester, West Sussex PO20 2FP
tel: 01243 622282


-----Original Message-----
From: Rob Smith [mailto:rob.smith at THERMON.com]
Sent: 30 January 2003 15:09
To: 'thelist at lists.evolt.org'
Subject: RE: [thelist] Javascript:self.close() w/out Warning

Sweet! Thanks .jeff.

p.s. I'll send a tip with my next problem ;-)

-----Original Message-----
From: .jeff [mailto:jeff at members.evolt.org]
Sent: Wednesday, January 29, 2003 6:39 PM
To: thelist at lists.evolt.org
Subject: RE: [thelist] Javascript:self.close() w/out Warning


rob,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Rob Smith
>
> Is there a way to close the browser window with
> Javascript that doesn't prompt the user?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

yes.  if it's opened from javascript then it's simple.  if it wasn't opened
from javascript then it's alittle more difficult.

<tip type="JavaScript" author=".jeff">

have a window that isn't created with javascript that you want to close and
you don't wanna have the user see that annoying dialog?  well, it's as
simple as assigning the current window object to the opener property of the
window.  then you can close it with no dialog.

<script language="JavaScript" type="text/javascript">
<!--
  window.opener = self;
  window.close();
// -->
</script>

</tip>

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/

--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !
--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !


DISCLAIMER: The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this email by
anyone else is unauthorised. If you are not the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be taken
in reliance on it, is prohibited and may be unlawful.





More information about the thelist mailing list