Esta página foi traduzida do inglês pela comunidade. Saiba mais e junte-se à comunidade MDN Web Docs.

View in English Always switch to English

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 recursos
dependentes terminaram de carregar.

Informações Gerais

Especificação

DOM L3

Interface

UIEvent

Bubbles

Não

Cancelavel

Não

Alvo

Window

Ação Padrão

Nenhuma.

Propriedades

Property Type Description
target Somente leitura EventTarget The event target (the topmost target in the DOM tree).
type Somente leitura DOMString The type of event.
bubbles Somente leitura Boolean Whether the event normally bubbles or not.
cancelable Somente leitura Boolean Whether the event is cancellable or not.
view Somente leitura WindowProxy document.defaultView (window of the document)
detail Somente leitura long (float) 0.

Exemplo

html
<script>
  window.addEventListener("load", function (event) {
    console.log("Todos os recursos terminaram o carregamento!");
  });
</script>

Eventos Relacionados