What is the purpose of the abort event?

Asked

Viewed 37 times

1

I found no reference explaining in practice what this event is for (abort), even in the example below:

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>example</title>
</head>
<body>
    <video src="video/test.mp4" controls></video>
    
    <script>
        let video = document.querySelector("video");
        
        video.onabort = () => {
            alert("Aborted");
        }
    </script>
</body>
</html>

When will the event be triggered abort? the W3schools defines this event as:

The onabort event occurs when the user stops loading an element

What do you mean, stop loading the element? someone tells me how this event works and if possible an example.

  • No friend! wanted an example of the event occurring and running something when it occurs

  • The operation of the element, you described in your own question. You also have the answer indicated by @Icaro Martins. And the whole thing is pretty trivial. What you apparently want to know is how the user can stop loading an element, and the main way is pretty simple too: by clicking the x button that usually gets close to the arrows and the reload button.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.