Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 166635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:07:56+00:00 2026-05-11T12:07:56+00:00

Here is the situation: A page ( iframe.html ) has an iframe loading another

  • 0

Here is the situation:

  • A page (iframe.html) has an iframe loading another page (iframe-content.html).
  • An JavaScript error might happen when iframe-content.html is loaded in the iframe.
  • I’d like that exception to be visible to the browser (e.g. shown in Firefox error console, or Firebug).

Here is what I see:

  1. When iframe.html is initially loaded, and loads iframe-content.html with src='iframe-content.html', the JavaScript exception shows in Firebug.
  2. However, if the page is loaded in JavaScript (document.getElementById('iframe').src = 'iframe-content.html'), the exception doesn’t show.

You can reproduce this by going to:

  1. http://avernet.googlepages.com/iframe.html with Firefox.
  2. You’ll see the exception as iframe-content.html is loaded.
  3. Click on the button: the content of the iframe is loaded again, but this time the exception doesn’t show in Firebug.

Is there a way at #3 to have the exception show, instead of it being silently ignored? (You can’t use a try/catch around the JS code that sets the src, as this code returns immediately before the page is loaded in the iframe.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:07:56+00:00Added an answer on May 11, 2026 at 12:07 pm

    It seems that your iframe page is not really loaded on the second time. Or it’s loaded from the cache and the error is ignored. This is interesting, but I think I found an way around it.

    function setContent() {     try {         console.log('Loading iframe content');         document.getElementById('iframe').src = 'iframe-content.html?foo=bar';     } catch (e) {         console.log('Caught', e);     }     console.log('Done loading'); } 

    With that the error should appear.

    What I did, was to trick the browser to think that I’m loading a brand new page as the parameters after the url have changed.

    'iframe-content.html?foo=bar'; 

    You could replace my ‘bar’ string with a changing timestamp. Sure, it would avoid the cache, but it would also force it to generate the error like you wished.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 210k
  • Answers 210k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer __getitem__ only accepts one argument (other than self), so you… May 12, 2026 at 9:52 pm
  • Editorial Team
    Editorial Team added an answer You cannot do what you are requiring. But you might… May 12, 2026 at 9:52 pm
  • Editorial Team
    Editorial Team added an answer I've had this problem with Visual Studio, too. We use… May 12, 2026 at 9:52 pm

Related Questions

A well known problem with Java Applets in webpages is that browsers ignore the
Here's my situation. I have a DotNetNuke application. I want to link to an
First and foremost let me state that I know that accessing server side controls
A situation requires me to order javascript code on a page be executed with

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.