GlobalEventHandlers.onloadend

这篇翻译不完整。请帮忙从英语翻译这篇文章

概述

onloadend属性表示当代码被调用时优先级提高,资源的加载事件触发时调用处理函数。

语法

img.onloadend = funcRef;

funcRef is the handler function to be called when the resource's loadend event fires.

示例

HTML 

<img src="myImage.jpg">

JavaScript 

// '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
Living Standard 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.

文档标签和贡献者

 此页面的贡献者: hisuny, littlemosquito
 最后编辑者: hisuny,