views:

94

answers:

1

I have used the jQuery dialog code so that I can prompt my user. Is there a way to catch if the user clicks the close button (the 'X' in the top right? Thanks.

+1  A: 

You shuold be able to just catch the beforeclose event (docs to be found here).

Banang
Great, just the job, thanks.Out of curiosity, why does this work:beforeclose: function duffy(){MyFunctionToCancel()},but not this:beforeclose: MyFunctionToCancel(),Thanks again.
Ben
It works because what you're supplying is a callback, rather than just making a function call. Also, a bit of SO manners, you should mark my answer as the accepted one to signal to others that this is the correct answer. ;)
Banang