Google News
logo
JavaScript - Interview Questions
Why do we use onabort event in JavaScript?
The onabort event is executed when the loading of an image is aborted. Use it in an image tag like this:
 
<img src="demo_image.jpg" onabort="display()">

Here, you can display an alert when the loading of image aborts : 
 
function abortFunc()
{
  alert('Image isn’t loading!');
}
Advertisement