views:

141

answers:

3

Hi,
How to disable (X) button in window.

I tried with some properties like titlebar=no/0 in window.open but it is not working fine. Can anybody help me with this query.

Thanks in advance

+4  A: 

See this page and this page. You can handle the onunload event, but there's nothing you can do to prevent a window from being closed; the best you can do prompt the user if they want to "navigate away from the page".

wj32
I did similar workout, but first I called window.close();In body have a method onunload="muMethod();"in this method have few boolean conditions as well as if condition to perform the activity.
Sai Prasad
But apart from this is there any other suggestion for performance tuning.
Sai Prasad
+1  A: 

You cannot disable a close button as wj32 said the best thing you can do is show a warnign if they are closing the window.

Shoban
A: 

But I tried with calling a script in onunload method in body tag it is working fine

Sai Prasad
Your requirements need to be re-evaluated; what you want to do isn't supported for security reasons. Users must be able to close windows if they choose. If you absolutely must do this, HTML+JScript isn't the right platform.
jeffamaphone
Then is there any other option to disable (X) button.What may be the security problems over here?
Sai Prasad