This page was translated from English by the community.Learn more and join the MDN Web Docs community.
load
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since июль 2015 г..
Событиеload происходит когда ресурс и его зависимые ресурсы закончили загружаться.
In this article
General info
- Спецификация
- Интерфейс
UIEvent
- Всплывает
Да
- Отменяемое
Нет
- Цель
Window
- Default Action
Нет.
Свойства
| 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. |
Пример
html
<script> window.addEventListener("load", function (event) { console.log("All resources finished loading!"); });</script>