Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
Need difference - setTimeout(callback, 0) vs $(window).load

What's the difference between these? Will event loop be formed after the page load got finished ?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

They are so different that it isn't really worth comparing them.


Binding an event handler to the load event will call that function when:

  • The load event fires (which is after the page and all its non-async dependencies have loaded) and
  • The event loop isn't busy with something else

Passing a function to setTimeout with a time of 0 will call that function when:

  • 0ms have passed and
  • The minimum timeout for the JS engine has passed and
  • The event loop isn't busy with something else (which includes the script which called setTimeout in the first place
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda