Can I use JavaScript to detect when a page load is cancelled or stopped? This occurs when the browser's stop button is clicked. I do not wish to capture the esc
button and would like to capture a browser event that occurs when the browser button is clicked.
Asked
Active
Viewed 239 times
1
-
2@mplungjan your duplicate does not provide a solution and that answer is a hack that does not answer this question – May 10 '20 at 17:33
-
1It was the top one I found. Click on the other links I posted and then tell us which code you tried and why they did not work for you. If you want to determin esc over stop, then you are likely needing a hack anyway – mplungjan May 10 '20 at 17:34
-
[How to detect escape](https://stackoverflow.com/questions/3369593/how-to-detect-escape-key-press-with-pure-js-or-jquery) – mplungjan May 10 '20 at 17:36
-
2You're looking for [window.onabort](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onabort) event, which most browser's don't seem to fire – anthumchris May 10 '20 at 17:45
-
onabort looks great. thank you so much – May 10 '20 at 21:37