The onloadend
property of the GlobalEventHandlers
mixin is an event handler representing the code to be called when the loadend
event is raised (when progress has stopped on the loading of a resource.)
The onloadend
property of the GlobalEventHandlers
mixin is an event handler representing the code to be called when the loadend
event is raised (when progress has stopped on the loading of a resource.)
img.onloadend = funcRef;
funcRef
is the handler function to be called when the resource's loadend
event fires.
<img src="myImage.jpg">
// 'loadstart' fires first, then 'load', then 'loadend' image.addEventListener('load', function(e) { console.log('Image loaded'); }); image.addEventListener('loadstart', function(e) { console.log('Image load started'); }); image.addEventListener('loadend', function(e) { console.log('Image load finished'); });
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
onloadend |
No |
No |
52
See bug 1574487.
|
No |
No |
No |
No |
No |
52
See bug 1574487.
|
No |
No |
No |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onloadend