Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!