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

  • SEARCH
  • Home
  • 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 8467119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:33:03+00:00 2026-06-10T15:33:03+00:00

I have multiframe application, where each form opens in separated frame and can use

  • 0

I have multiframe application, where each form opens in separated frame and can use some JS API from parent window. API can throw an exception (error), but I can’t catch it in iframe. It is reproduced in IE8 only. I’ve checked it in IE8/IE9 and Chrome. e.g.:
test.html

<html>
  <head>
    <script language="JavaScript" type="text/javascript">
      var g_fn = {};
      function onLoad() {
        g_fn.thrown_error = function() {
          throw new Error("Main window: error");
          return 1;
        }
        window.g_fn = g_fn;
      }

      function window_do() {
        try {
          g_fn.thrown_error();
        } catch (err) {
          alert("Error catched!");
        }
      }
    </script>
  </head>
  <body onload="onLoad();">
    <input type="button" value="do smth in window" onclick="window_do();"/>
    <iframe src="/iframe.html" />
  </body>
</html>

iframe.html

<html>
  <head>
    <script language="JavaScript" type="text/javascript">
      var g_fn;
      function onLoad() {
        g_fn = window.parent.g_fn;
      }

      function iframe_do() {
        try {
          g_fn.thrown_error();
        } catch (err) {
          alert("Error catched!");
        }
      }

    </script>
  </head>
  <body onload="onLoad();">
    <input type="button" value="do smth in iframe" onclick="iframe_do();"/>
  </body>
</html>

Is that an IE-bug? Any workarounds?

  • 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. Editorial Team
    Editorial Team
    2026-06-10T15:33:04+00:00Added an answer on June 10, 2026 at 3:33 pm

    Try this:

    g_fn = window.frameElement.g_fn;
    

    Or this, if there are iframes inside iframes:

    g_fn = top.window.g_fn;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write an app to playback a DICOM multiframe image. Each frame
Have one Doubt In MVC Architecture we can able to pass data from Controller
Have an app that can use tts to read text messages. It can also
Have whats probably a simple problem with using parent in if and each statements
Have a quick theoretical question - if somebody can help answer: The application commands
have a nice day. I got problem when trying to create an image from
I need to separate multiframe tiff files, and use the following method: public static
Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
Have converted devise new session from erb to Haml but doens't work, this is
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:

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.