Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to close window by window.close() without confirmation box

Status
Not open for further replies.

haroonkhalid

Programmer
Nov 6, 2001
16
0
0
SG
hi,
I am trying to close the browser window by javascript:window.close() but it shows up the confirmation box and asks for YES or NO. The page in browser has frames in it. I am running it on IE5

Is there any way to close that window without confirmation box in IE5 (if not in both IE and Netscape).
 
Sorry. That is a security feature in IE and most versions of NS. I have noticed that my NS6 does not ask me if I want to close it, so I'm wondering if the browsers are lightening up on this issue.

But for now, there's now way to disable it. It was originally intended to allow you to close the main browser window as long as it had no more than 1 item in session history, thus it would be OK for you to close a browser window that was only opened for the purpose of visiting your site. But I've tried it, and it still prompts in IE5 and NS4.

Wish I could be of more help.

ToddWW
 
so what about activeX then? (BB, it is not about you)

look: thread216-82344

:)
 
the only problem with that is that it does not work in ns Robert Carpenter
questions? comments? thanks? email me!
eclipse_web@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
Todd: how many times have you answered that question in the last week or so? Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
I'm not sure, I just answered another one a few minutes ago. It seems to be what everyone wants to do.. That is, either modify the main browser window OR create their own window and close the main one.

The post I just answered was about removing the menu bar from the main window. I told him, probably not and he should stick with opening a new window. Now, watch.. we'll get a reply here in a few minutes to the effect of, "OK, thanks.. Now how do I close the main browser window and not get the prompt ??".

Very popular request !!

ToddWW
 
You can window.close() a window that has been opened using a window.open(), this method will not prompt you with a message when you call window.close()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top