1

Im a php developer interested in going a little more client side. I need to find a way to create some kind of dialogue when either the browser back or window close buttons are hit. Can you give me an idea of the best way to go about this.

Many thanks Giles

giles
  • 11
  • 1
  • I suspect this has been asked before. One similar question is [here](http://stackoverflow.com/questions/460646/html-window-object-onclose-or-closing-event) – sje397 Jul 10 '10 at 14:59

2 Answers2

0

I think you want the 'onbeforeunload' event, or 'onunload'.

Some discussion here

For a dialog, I would look at the dialog widget from Jquery UI.

sje397
  • 41,293
  • 8
  • 87
  • 103
0

Here's a good place to start: https://developer.mozilla.org/en/DOM/window.onunload.

Ken Earley
  • 769
  • 4
  • 14