1

How can I run javascript when user close the browser. I tried to use 'onunload', but it calls every time I press F5/refresh button? Thanks

ihorko
  • 6,855
  • 25
  • 77
  • 116

1 Answers1

2

As far as the Javascript on the page is concerned, there's no difference between closing the browser, navigating to another page or refreshing the same page.

nickf
  • 537,072
  • 198
  • 649
  • 721