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
происходит когда ресурс и его зависимые ресурсы закончили загружаться.
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>