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

138
Visualizações
Is it possible to catch errors within an iframe with Javascript?

I'm using the lightwidget to include instagram posts to my website with an iframe.

Some people have Firefox settings / plugins to block posts from instagram, so they'll get the error: GET https://scontent-frx5-1.cdninstagram.com/v/somepost net::ERR_NAME_NOT_RESOLVED

because the images wont load. Can I somehow catch that error?

I want to show some message instead and display: none; the iframe, so the user doesn't see an endless spinning wheel.

I tried to catch the error like this, but it didn't work:

window.addEventListener('error', function(event) { 
    alert('error')
})

Thanks for any help

about 4 years ago · Juan Pablo Isaza
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