Esta página foi traduzida do inglês pela comunidade.Saiba mais e junte-se à comunidade MDN Web Docs.
load
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since julho de 2015.
O evento de load é acionado quando um recurso e seus recursosdependentes terminaram de carregar.
In this article
Informações Gerais
- Especificação
- Interface
UIEvent
- Bubbles
Não
- Cancelavel
Não
- Alvo
Window
- Ação Padrão
Nenhuma.
Propriedades
| Property | Type | Description |
|---|---|---|
targetSomente leitura | EventTarget | The event target (the topmost target in the DOM tree). |
typeSomente leitura | DOMString | The type of event. |
bubblesSomente leitura | Boolean | Whether the event normally bubbles or not. |
cancelableSomente leitura | Boolean | Whether the event is cancellable or not. |
viewSomente leitura | WindowProxy | document.defaultView (window of the document) |
detailSomente leitura | long (float) | 0. |
Exemplo
html
<script> window.addEventListener("load", function (event) { console.log("Todos os recursos terminaram o carregamento!"); });</script>