How to close the Web Browser ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does any one know to close the web browser automatically after logging off

Your help will be appreciated

gin lye
 
You would need to use a client side script to do that. After the user has
clicked "Log off", the server could send a page that contains only such a
script. A very simplified version could look like this:

<html>
<head>
</head>
<body onload="self.close();">
You are logged off.
</body>
</html>

or if you prefer:

<html>
<head>
</head>
<body>
<script language="javascript">
self.close();
</script>
You are logged off.
</body>
</html>

Note that "self" is a static property of the window class refering to the
current browser window instance (like the property Current in many .NET
classes).

The only problem is that most browsers pops up an OK/Cancel dialog when
ordered to close, so you might want to put some content into the page as
well in case the user cancels. An exception to this is when you close a
modal pop-up dialog page, then you won't get this confirmation.

Helge
 
Additionaly the user may want to use the browser to go to another site after
logging off (ie closing the browser automatically could be sometimes
annoying)...

Patrice

--
 
Back
Top