load

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

O evento de load é acionado quando um recurso e seus recursos
dependentes terminaram de carregar.

Informações Gerais

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