GlobalEventHandlers.onloadend

翻译不完整。 请帮助我们翻译这篇文章!

GlobalEventHandlersonloadend 属性是用来 表示触发loadend事件时(资源加载进度停止时)的EventHandler

语法

img.onloadend = funcRef;

Value

funcRef是在事件源的loadend事件触发时要调用的处理函数。

范例

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');
});

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
onloadendChrome No support NoEdge No support NoFirefox Full support 52IE No support NoOpera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 52Opera Android No support NoSafari iOS ? Samsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown