PDA

View Full Version : Want to close Internet Explorer using JavaScript


sonibhavinh
06-28-2002, 06:34 AM
I have created an application in which i want to give a exit link on which if the user clicks, the Internet Explorer should be closed. Is It possible if yes plz give me the answer (i.e the code) for doing it. It is very much urgent plz ans me...

sonibhavinh
06-28-2002, 07:42 AM
i have found the solution for this ie the code goes this way..


//<a href="javascript:window.close()">Close</a>


Now, what i want is that after clicking on the "Close" link it prompts me an Internet Explorer message i.e.

"The Web Page You are viewing is trying to close the Window"
"Do You Want to close the window"
"Yes" "No"
I dont want any message to be displayed or if that can not be possible want to give my own message and than it should not show the above message(default message).

Zvona
06-28-2002, 07:49 AM
<!-- Example written by Zvona -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1;">
<title>fatality</title>
</head>
<body onload="(document.all)?ikkuna.Click():close();">
<object id="ikkuna" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
</body>
</html>

From: http://www24.brinkster.com/zvona/htmlexa.asp?article=04

sonibhavinh
06-28-2002, 08:01 AM
To Zvona

The code u have sent to me is calling the function in the body onload. So it dont allow the page to get open and i dont want this. I want is when any one clicks on the link Close it should not display any default IE message and close the Browser or if that is not possible should want to display only my own message. Plz help me...

Quiet Storm
06-28-2002, 05:17 PM
<HEAD>

<OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><PARAM NAME="Command" VALUE="Close"></OBJECT>

</HEAD>
<BODY>

<A HREF="#" onClick="closes.Click();">Exit!</A>

</BODY>