Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

-Web site designers FAQ

HTML: How To...

How do I close a browser without prompting the user? by skiflyer
Posted: 31 Mar 03 (Edited 15 Jul 03)

This code is actually javascript, but the question comes up often in this forum, and I don't take credit for the solution, but I thought it might be a good place to have it.

<script type="text/javascript" language="javascript">
function bye() {


As per a suggestion, I'll be a bit more explicit... this function should be placed in whichever window it is you want to close, and then be called as a simple


<input type="button" name="close" value="Close the page" onClick="bye();" />

As fair warning, this is not fully javascript compliant, fully compliant browsers will tell you that you can not close a window which you did not open with the script.  However, since Microsoft defines it's own standards, this works in IE 6 until they decide to change it.


Back to -Web site designers FAQ Index
Back to -Web site designers Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close