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

254
Visualizações
jQuery equivalent of body onLoad

Is it allowed to use <body onLoad="myfunc()"> along with jQuery's document.ready() handlers? I can't find a way to achieve the same functionality of the <body onLoad> with jQuery.

An example of a use case would be a facebook application. An Iframe facebook app requires the use of the FB.Canvas.setSize function which resize the iframe.

I would need to fire it up only when all elements on the page are finished loading.

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

$(window).load(myfunc) is what you're looking for. If you're working with the load event of an iframe, you can replace window with the iframe element/selector.

over 4 years ago · Santiago Trujillo Relatório

0

This works as well:

$(window).load(function(){
    // ..
    myfunc();
    // ..
});
over 4 years ago · Santiago Trujillo Relatório

0

From the jQuery API on the ready handler:

The .ready() method is generally incompatible with the <body onload=""> attribute. If load must be used, either do not use .ready() or use jQuery's .load() method to attach load event handlers to the window or to more specific items, like images.

over 4 years ago · Santiago Trujillo 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