Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > close browser window

Reply
Thread Tools

close browser window

 
 
olga p.
Guest
Posts: n/a
 
      01-16-2004
Hi,

I would like to close the browser window when I open the new one. Now I'm
getting really irritation message: do I really want to close it, yes or no.
I just want to close the browser without the message.

Does anybody know the solution?

greatings,

Olga


 
Reply With Quote
 
 
 
 
Harag
Guest
Posts: n/a
 
      01-16-2004
On Fri, 16 Jan 2004 13:13:25 +0100, "olga p." <(E-Mail Removed)>
wrote:

>Hi,
>
>I would like to close the browser window when I open the new one. Now I'm
>getting really irritation message: do I really want to close it, yes or no.
>I just want to close the browser without the message.
>
>Does anybody know the solution?


The only windows you can close via scripting are the windows that the
scripting opens.

you cannot close the original window that the user opens with a
shortcut... (well you can but the user has the choice as you can see).


HTH
Al

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      01-16-2004
Harag wrote:

> On Fri, 16 Jan 2004 13:13:25 +0100, "olga p." <(E-Mail Removed)>
> wrote:
>
>
>>Hi,
>>
>>I would like to close the browser window when I open the new one. Now I'm
>>getting really irritation message: do I really want to close it, yes or no.
>>I just want to close the browser without the message.
>>
>>Does anybody know the solution?

>
>
> The only windows you can close via scripting are the windows that the
> scripting opens.
>
> you cannot close the original window that the user opens with a
> shortcut... (well you can but the user has the choice as you can see).


I think, for the sake of doing it, I will keep my mouth (and fingers)
shut this time, its been beaten to death.

Needless to say, you *can* [1] close that window without a prompt.
Search the archives.

[1] In about 80% (??) of circumstances.

P.S. The Unconditional Truth might surprise you.


--
Randy

 
Reply With Quote
 
DJ WIce
Guest
Posts: n/a
 
      01-16-2004
: The only windows you can close via scripting are the windows that the
: scripting opens.
:
: you cannot close the original window that the user opens with a
: shortcut... (well you can but the user has the choice as you can see).
In the past you could:

- open a child
- let the child replace the current location of the parent, not via parent..
but via the name you gave the parent.
- then try to close the parent via that name.

I may hope this bug is fixed by now for all browsers.
The browser (MSIE) just though the child became parent of it's parent.

Wouter


 
Reply With Quote
 
Richard Cornford
Guest
Posts: n/a
 
      01-16-2004
"DJ WIce" <(E-Mail Removed)> wrote in message
news:bu8n36$8js$(E-Mail Removed)...
<snip>
>- open a child
>- let the child replace the current location of the parent, not via
>parent.. but via the name you gave the parent.
> - then try to close the parent via that name.
>
>I may hope this bug is fixed by now for all browsers.
>The browser (MSIE) just though the child became parent of it's parent.


That is a very convoluted way of exploiting the bug that Randy alluded
to, an probably less reliable than the usual[1] method.

Richard.

[1] Not usual in the sense that this is often done as it is a really
*bad* idea to shut down someone else's software without asking them
first, you never know what you might be destroying in the process.


 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      01-16-2004
DJ WIce wrote:
> : The only windows you can close via scripting are the windows that the
> : scripting opens.
> :
> : you cannot close the original window that the user opens with a
> : shortcut... (well you can but the user has the choice as you can see).
> In the past you could:
>
> - open a child
> - let the child replace the current location of the parent, not via parent..
> but via the name you gave the parent.
> - then try to close the parent via that name.
>
> I may hope this bug is fixed by now for all browsers.
> The browser (MSIE) just though the child became parent of it's parent.


Its not even that difficult. I can close the original page (In certain
browsers), without opening a second window at all.


--
Randy

 
Reply With Quote
 
Jim Ley
Guest
Posts: n/a
 
      01-16-2004
On Fri, 16 Jan 2004 13:06:22 -0500, Randy Webb
<(E-Mail Removed)> wrote:


>Its not even that difficult. I can close the original page (In certain
>browsers), without opening a second window at all.


Yeah, but that's not really being anti-social

screen.bufferDepth=2

now that's anti-social.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

 
Reply With Quote
 
Christopher Jeris
Guest
Posts: n/a
 
      01-16-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Jim Ley) writes:
> screen.bufferDepth=2
> now that's anti-social.


Damn.

That's horrible.

Somebody should have each bone in their hands broken with
a hammer for specifying that.

(but did you mean 1? msdn seems to say that 2 is equivalent to -1,
and testing on IE6 verifies this)

--
Chris Jeris (E-Mail Removed) Apply (1 6 2 4)(3 7) to domain to reply.
 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      01-17-2004
Jim Ley wrote:

> On Fri, 16 Jan 2004 13:06:22 -0500, Randy Webb
> <(E-Mail Removed)> wrote:
>
>
>
>>Its not even that difficult. I can close the original page (In certain
>>browsers), without opening a second window at all.

>
>
> Yeah, but that's not really being anti-social
>
> screen.bufferDepth=2
>
> now that's anti-social.


<g> aint it though?

--
Randy

 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      01-17-2004

"Jim Ley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Fri, 16 Jan 2004 13:06:22 -0500, Randy Webb
> <(E-Mail Removed)> wrote:
>
>
> >Its not even that difficult. I can close the original page (In certain
> >browsers), without opening a second window at all.

>
> Yeah, but that's not really being anti-social
>
> screen.bufferDepth=2
>
> now that's anti-social.


Stick it in your onUnload. Then the next site gets blamed

Cheers
Richard


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to close a TCP socket? (TCPSocket#close doesn't close it) IƱaki Baz Castillo Ruby 7 01-12-2010 01:32 PM
close all child windows when close the main window jrefactors@hotmail.com HTML 6 08-07-2008 09:10 AM
Browser close event (MSIE and FF): how to detect browser close ? pamelafluente@libero.it Javascript 0 01-23-2007 12:44 AM
close current window using window.close() Shang Wenbin Javascript 10 09-02-2005 12:16 AM
How to close child browser while parent close? Denon ASP .Net 1 11-14-2003 08:14 AM



Advertisments