Monday, April 25, 2011

Problem with (X) button in window.

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

From stackoverflow
  • 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".

    Sai Prasad : 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.
  • 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.

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

    jeffamaphone : 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.
    Sai Prasad : Then is there any other option to disable (X) button. What may be the security problems over here?

0 comments:

Post a Comment