javascript - How to tell if a web page is being exited/unloaded via flash versus via normal HTML -
I have a flash app, which redirects to another page. I would love to trap any other window loading (clicking on the link / submitting the form) and warn the user that they will lose their progress in the flash app.
However, I can not find a way to tell that the click / change of URL / window unloads is being started from Flash vs. Normal Links etc.
Is there any way to detect it, and how reliable is it?
There is no point in what happened to an unload event directly in the event handler. However, you can get it by attaching an onclick event handler to each link on that page which sets a variable. In jQuery: Click
$ ("A") (function () {window.clickedLink = this});
You can read the link clicked on your unload event and tell the difference.
Comments
Post a Comment