4

Possible Duplicate:
Is there a way in javascript to detect if the unload event is caused via a refresh, the back button, or closing the browser?

Hi all

I have the below set of code

$(window).unload( function() {
   test();
});

the test() will call when i close the window and also if i refresh the window ..... How can identify is it a refresh or close event . I need to call test() only at close event. Please help me...

Community
  • 1
  • 1
Nisanth Kumar
  • 5,667
  • 8
  • 33
  • 43
  • 1
    Sorry, not possible, as has been determined before. For example here: http://stackoverflow.com/questions/291553/is-there-a-way-in-javascript-to-detect-if-the-unload-event-is-caused-via-a-refres – deceze Mar 10 '10 at 06:33
  • Be careful with the unload event - It might not work properly in some browsers. – Alex Mar 25 '10 at 12:09

0 Answers0