Forum Moderators: open

Message Too Old, No Replies

how to disable the close (X) window button?

         

gparte

6:27 pm on Nov 22, 2001 (gmt 0)



Hi

Apologies for the english.

I need to perform some actions when the user closes an intranet application.

The application has a "disconnect" link, but the users rarelly use it, instead they use the (X) close button.

So, i need to disable this button, or at least try to capture the "close event" to perform the actions .

Is this possible?

Regards

tedster

7:58 pm on Nov 22, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



gparte, welcome to Webmaster World

How about using onUnload in the document? I think this is exactly the kind of situation it was created for.

jatar_k

12:35 am on Nov 23, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the only problem with onunload is that it isn't supported in netscape. If all your users are IE folk then you're all right but that seems unlikely. There is also a onbeforeunload event, though again unsupported in netscape. I don't know of a way to disable the x button without using C++. If what you have to do is on a server you could maybe try somethig serverside on a time out.

tedster

1:44 am on Nov 23, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jatar_k, you must be thinking of a different Javascript event handler. OnUnload has been supported since Netscape 2.

reference [developer.netscape.com]

jatar_k

2:31 am on Nov 23, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



hehe, good point. I never thought I would say it but one strike against o'reilly's, since that is where I read it. Never post when exhausted, thx tedster for setting me straight.