Javascript examples for DOM Event:addEventListener
The onabort event occurs when the user aborts the loading of an <img> or <input type="image"> element.
Bubbles | Yes |
---|---|
Cancelable | No |
Supported HTML tags: | <img> and <input type="image"> |
Execute a JavaScript if loading of an image is aborted:
<!DOCTYPE html> <html> <body> <image id = 'demo' src='http://java2s.com/resources/a.png' onabort="myFunction()"/> <script> document.getElementById("demo").addEventListener("abort", myFunction); function myFunction() {//from w w w .j a va 2 s . co m console.log("abort"); } </script> </body> </html>