1

I have a YUI application. Under certain circumstances I want to alert the user before he closes the window. Therefore I capture the window close event and do

onWindowClose: function(e) {
        if (...)
        {
            YAHOO.util.Event.preventDefault(e);
        }
    }   

The browser shows a standrd message: "Are you sure you want to navigate away from this page? Press OK to continue, cancel to stay in the current page".

How can I customize the message the browser shows?

flybywire
  • 247,088
  • 187
  • 391
  • 495

1 Answers1

1

Check for onbeforeunload event and my answer in

show a message box when user close IE

and

ASP.NET: Warning on changed data closing windows

It may work for you.

Community
  • 1
  • 1
lakshmanaraj
  • 4,130
  • 22
  • 12