Is there anyway to prevent onbeforeunload event from triggering when using internet explorer
- by newName
I have a function that is suppose to trigger when user closes their browser and I have put the code in the "window.onbeforeunload" function.
The thing is every time if I reloads the page in Internet Explorer, the onbeforeunload event will also trigger which is a problem because I only wants it to trigger only when the user closes or navigates away from the current page but not on a page refresh/reload.
Therefore I'm not sure if onbeforeunload is intended to trigger even on a page refresh/reload and if it is intended to, then is there another way to work round it? Thanks