PDA

Click to See Complete Forum and Search --> : Close a browser window...


rjlohan
Oct 10th, 2001, 05:12 PM
How can I close a browser window without getting a standard browser confirm box? This is ****ting me up the wall...

This is the code I am using... the 2nd window opens fine, but the one I am in keeps asking for a second opinion. Goddamn it!!!

window.close();
window.open("login.asp", "LoginWindow", "menubar=no, directories=no, location=no, resizable=no, toolbar=no");

:mad: :mad: :mad:

filburt1
Oct 10th, 2001, 05:28 PM
If you are getting the script warning "A script is trying to close the browser window" or something like that, you can't get around it; it is a feature of the browser.

rjlohan
Oct 10th, 2001, 05:44 PM
I've been looking into it elsewhere. Apparently there are ways around it, but they aren't 100%.

That's a real pain in the arse. Makes doing anything mildly professional looking very bloody difficult...

:mad:

sail3005
Oct 12th, 2001, 11:26 AM
i think that you can still close it...maybe...but you will get that confirm close box.

I know that if you created the popup, it will not ask you to confirm (at least in IE)

scoutt
Oct 12th, 2001, 07:55 PM
Originally posted by rjlohan
That's a real pain in the arse. Makes doing anything mildly professional looking very bloody difficult...

:mad:
how professional is it to close the main window if I opened it up?? it is like when I go to your site and you close all my browser windows that would piss me off. close a window that you didn't open, is like having 50 popups on your page. and we know how many people hate popups ;)

The Hobo
Oct 12th, 2001, 08:43 PM
Man's got a point...

sail3005
Oct 12th, 2001, 08:56 PM
i disabled popups

rjlohan
Oct 12th, 2001, 09:33 PM
It is perfectly professional. The windows I am trying to close are ones the site doesn't need, however not with window.open().

I need to open a second window to remove the menubar, toolbar, etc. from the display, otherwise later on .asp scripts will get buggered up.

But when I open this second window, there is no need for the index.html which opened it, and I'd rather close it than leave it open. It is basically just a dummy window.

I can't find a way to remove those things from the display within a page, only through the window.open() method.

If you have any suggestions, feel free to share, but don't start lecturing me on the ethics of pop-up windows, or closing browser windows. In this instance it is perfectly legitimate. I can find no other way to disable the 'Back' function in the browser, but I also don't want my dummy windows sitting around.

scoutt
Oct 12th, 2001, 10:19 PM
Originally posted by rjlohan
It is perfectly professional. The windows I am trying to close are ones the site doesn't need, however not with window.open().

I need to open a second window to remove the menubar, toolbar, etc. from the display, otherwise later on .asp scripts will get buggered up.

But when I open this second window, there is no need for the index.html which opened it, and I'd rather close it than leave it open. It is basically just a dummy window.

I can't find a way to remove those things from the display within a page, only through the window.open() method.

If you have any suggestions, feel free to share, but don't start lecturing me on the ethics of pop-up windows, or closing browser windows. In this instance it is perfectly legitimate. I can find no other way to disable the 'Back' function in the browser, but I also don't want my dummy windows sitting around.
dummy window that the surfer opened to get to your site. how is that a dummy window?? if it wasn't for that window you would not get any visitors.
the toolbar and address bar have nothing to do with your scripts.
start lecturing you on ethics?? I don't care what you do with your site but if you want visitors to stay at your site I would think of another method of doing what you want. like I said I don't care what you do, but being a webmaster, it is your job to make the surfer happy and stay at your site not piss them off by closing windows that you didn't open. if i wanted to go to another site I would have to open another browser since the one you opened didn't have any toolbars or address bar. that would be enough to piss me off not to go back to your site.

I beleive that yahoo and cnn are professional sites and they don't do such actions. so explain to me how professional it is to close windows you didn't open.

just my opinion so don't get pissed at me.

sail3005
Oct 12th, 2001, 10:27 PM
it also screws their history.

rjlohan
Oct 13th, 2001, 03:41 AM
Because this isn't a website for surfers to come browsing through.

It is an online quiz which I am developing for a specific client. To get to this 'site' visitors must be registered. Most of them don't know squat about computers. So I really don't give two hoots about their history or whether they can't see menu bars.

The 'dummy window' is needed because the user must go through this other app (which is a load of **** anyway, but I can't do anything about that) to get to my quiz.

I don't want those things there because
a) I'd like more room for the actual app - the browser menubars/toolbars take up up to 1/4 of the screen.
b) Like I said, going 'back' screws up the app, and they don't need to anyway.

Don't assume that you know everything. You don't.