If your have your click setup similar to something like this:
or, if you’re using ASP.NET’s HyperLink control:
And your “doStuff()” function doesn’t redirect or closes the window – you’d expect it just do its stuff and that’s it. But in addition to it, or rather before it onbeforeunload event fires, so if you have some code in the event handler – it will be executed, which in this case is undesirable.
Why does it happen? Continue reading 'onbeforeunload event is fired on click'»