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

Rob Smith rob.smith at THERMON.com
Thu Jan 30 09:11:02 CST 2003


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 !



More information about the thelist mailing list