当一个资源及其依赖资源已完成加载时,将触发load事件。
常规信息
- 规范
- DOM L3
- 接口
- UIEvent
- 是否冒泡
- 否
- 能否取消默认行为
- 否
- 目标
- Document, Element
- 默认行为
- 无.
属性
| Property | Type | Description | 
|---|---|---|
| target只读 | EventTarget | The event target (the topmost target in the DOM tree). | 
| type只读 | DOMString | The type of event. | 
| bubbles只读 | Boolean | Whether the event normally bubbles or not | 
| cancelable只读 | Boolean | Whether the event is cancellable or not? | 
| view只读 | WindowProxy | document.defaultView(windowof the document) | 
| detail只读 | long(float) | 0. | 
例子
<script>
  window.addEventListener("load", function(event) {
    console.log("All resources finished loading!");
  });
</script>