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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing the browser to close 3

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi

When the user clicks on a link I want the browser to close. Is this possible?

Thanks
 
Hi,

You can use window.close(). This will work completely on pages that you have opened. (ie. popups).

If you use it on the parent page, the client will get a confirmation.

Search the site for more info, plenty of threads on this subject.

Gtz,

Kristof
 
can add smth :)
<!--this works in IE-->
<html>
<head>
</head>
<body>
<OBJECT id=closes type=&quot;application/x-oleobject&quot; classid=&quot;clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11&quot;>
<param name=&quot;Command&quot; value=&quot;Close&quot;>
</object>
<input type=&quot;button&quot; value=&quot;close window&quot; onclick=&quot;closes.Click();&quot;>
</body>
</html> Victor
 
Also.. another IE only solution:
Code:
<script language=&quot;javascript&quot;>
parent.location='cmd:ok';
</script>

Gotta love that netscape! LOL Not that I support MS either... but at least you can do things in IE! -gerrygerry
Go To
 
Ya know what sucks? When you test something, it works, then you go and tell people about it, then you try it again, and you cant get it to work again! Then you say to yourself, &quot;Hmmm, gerrygerry, i think you must be stupid, because you were using a command for an autorun program you use frequently... not javascript.&quot;

Just when I was starting to like IE...

*gerrygerry hides in corner, covering face in shame* -gerrygerry
Go To
 
cut it down, people! it wasn't my solution!!

ps: thanks :) Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top