Closing the browser

axum

Active member
Joined
Mar 28, 2003
Messages
40
Hi, after running through my processing, i need a click of the "Close" button to exit the whole program, and close the browser....Any ideas?

Cheers

Axum
 
Just a comment:

I never see any web application will "Close" the browser. Maybe because browser is not part of the program actually, so we should not close the browser, except there is a sub window...

For example: you login Yahoo mail and check your mail, after logoff, you expect Yahoo to close the browser for you? How if user want to use this browser for other thing?
 
eh? well the user cant use the browser for anything else!! thats a decision, i as the programmer, has made!

You CAN close it by just adding this to the OnClick event :

Response.Write("<script>window.close();</script>");

but then IE comes up with with a Yes/No confirmation message, anyone know if you can just close it without this confirmation?

Axum
 
It is in no way proper to close a browser window unless it was opened by a web page as an auxiliary window. Either open an auxiliary window and close that, or deal with the all-too-appropriate security thats built into browsers. The fact that the user has your web page loaded doesnt give that page any right to control the browser its being displayed in.
 
it does in an internal secure intranet environment surely?

and yes, it is opened by another browser...

but i take it there is NO way of getting round this YES/NO dialog box...?

Axum
 
Yes there is a way, if its an auxiliary window (as Derek just said). Ill try and find a sample later today.
 
which this is....an auxillary window...that would be fantastic mate :)

many thanks

Axum
 
many thanks mate, cant believe its as simple as that one line :)

Ah well, gotta know your javascript i guess!

Axum
 
Back
Top