当一个资源及其依赖资源已完成加载时,将触发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 (window of the document) |
detail 只读 |
long (float ) |
0. |
例子
<script>
window.addEventListener("load", function(event) {
console.log("All resources finished loading!");
});
</script>