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
  • 24,169
  • 25
  • 107
  • 177
ajm
  • 12,863
  • 58
  • 163
  • 234
  • 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. – ajm Sep 16 '13 at 07:25

0 Answers0