The onloadend
property of the GlobalEventHandlers
mixin is an EventHandler
representing the code to be called when the loadend
event is raised (when progress has stopped on the loading of a resource.)
Syntax
img.onloadend = funcRef;
Value
funcRef
is the handler function to be called when the resource's loadend
event fires.
Examples
HTML content
<img src="myImage.jpg">
JavaScript content
// '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'); });
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
onloadend | Chrome No support No | Edge No support No | Firefox Full support 52 | IE No support No | Opera No support No | Safari ? | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 52 | Opera Android No support No | Safari iOS ? | Samsung Internet Android No support No |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown