Свойство onloadend
от GlobalEventHandlers
примесь EventHandler
передает код для вызова в момент возникновения события loadend
(когда процесс загрузки ресурса окончился и остановился)
Синтаксис
img.onloadend = funcRef;
При возникновении события loadend
будет вызванна функция обработчик funcRef
.
Примеры
<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');
});
Спецификации
Specification | Status | Comment |
---|---|---|
HTML Living Standard Определение 'onloadend' в этой спецификации. |
Живой стандарт | Initial definition |
Поддержка браузерами
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | Нет | Нет | 52 (52)[1] | Нет | Нет | ? |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | ? | Нет | 52.0 (52)[1] | Нет | Нет | ? | Нет |
[1] As of Firefox 52, The loadend
event is now fired on <img>
elements.