1

I need to call javascript method when someone presses f5 or refreshes a page. For this I am using following javascript. It works in all browsers except chrome.

window.onbeforeunload = function(){
  myJsMethodToCall();
};

Please help.

Valamas
  • 23,171
  • 24
  • 104
  • 174
ashishjmeshram
  • 12,095
  • 56
  • 156
  • 228
  • 1
    possible duplicate of [window.onbeforeunload in Chrome: what is the most recent fix?](http://stackoverflow.com/questions/9626059/window-onbeforeunload-in-chrome-what-is-the-most-recent-fix) – Valamas Sep 16 '13 at 06:17
  • I did try the link above. But its not working in any of the browsers. – ashishjmeshram Sep 16 '13 at 07:25

0 Answers0