--- title: GlobalEventHandlers.onloadend slug: Web/API/GlobalEventHandlers/onloadend translation_of: Web/API/GlobalEventHandlers/onloadend ---
Свойство onloadend
от {{domxref("GlobalEventHandlers")}} примесь {{domxref("EventHandler")}} передает код для вызова в момент возникновения события {{event("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 |
---|---|---|
{{SpecName("HTML WHATWG", "webappapis.html#handler-onloadend", "onloadend")}} | {{Spec2("HTML WHATWG")}} | Initial definition |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatNo}} | {{CompatGeckoDesktop("52")}}[1] | {{CompatNo}} | {{CompatNo}} | {{CompatUnknown}} |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatNo}} | {{CompatGeckoMobile("52")}}[1] | {{CompatNo}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatNo}} |
[1] As of Firefox 52, The loadend
event is now fired on {{htmlelement("img")}} elements.