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 6162203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:36:44+00:00 2026-05-23T21:36:44+00:00

I came into a really strange situation. I have the following setup: Parent window

  • 0

I came into a really strange situation. I have the following setup:

Parent window has an object “bar” which includes an xml document and few other properties:

<html>
<head>
<script type="text/javascript">
var foo=null; //used in most report pages
var bar=function(document, boo){
    this.doc=document;
    this.boo=boo;
    this.baz="serge";
};
</script>
<head>  
<body>
    <iframe src="_child1.html"></iframe>
</body>
</html>

First child frame loads a simple xml file by ajax:

<html>
<head>
<script src="../lib/jquery.min.js"></script>
<script type="text/javascript">
$.ajax({
        url: "books.xml",
        type: "get",
        dataType: "xml",        
        success: function(data) {
            var boo = {
                name: "boo"
            };
            parent.foo = new parent.bar(data, boo);         
            alert(parent.foo.boo.name);
            alert(parent.foo.baz);
            alert(parent.foo.doc.firstChild.nodeName);
            window.location = "_child2.html";
        }
    });
</script>
</head>

<body>
    child1
</body>
</html>

The XML is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
    Vaidyanathan Nagarajan
</bookstore>

On success it creates a “bar” instance in the parent window and stores it in the “foo” variable which again resides in the parent window.

Then it outputs those properties (successfully) and redirects to a second child frame.

Second child frame tries to access the “foo” object in the parent frame and output its properties:

<html>
<head>
<script src="../lib/jquery.min.js"></script>
<script type="text/javascript">
alert(parent.foo.boo.name);
alert(parent.foo.baz);
alert(parent.foo.doc.firstChild.nodeName);
</script>
</head>

<body>
    child2
</body>
</html>

And now the interesting stuff happens:
in FF and Chrome we see the 3 properties fire two times: once in _child1 and secondly in _child2. In IE9 however, we see only 5 alerts!

And the reason for this is that parent.foo.doc throws “Permission denied” for some reason.

I believe that the reason is that somehow IE “remembers” that the xml document was created in the first child frame (perhaps for performance reasons) and when the second child frame tries to access that object IE isn’t able to find it (or stores it in a restricted memory stack).

Furthermore, when I tried this scenario without redirecting – just putting those two child frames in the parent frame together – the second child frame had no problem accessing the parents’ xml doc.

One workaround could be to clone those xml documents inside the “parents” before assigning, but we have many scenarios like this and first I would like to ask whether someone has a better idea?

Thanks.

  • 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-05-23T21:36:45+00:00Added an answer on May 23, 2026 at 9:36 pm

    Internet Explorer will absolutely not let you get away with using a JavaScript object allocated in a separate page once that separate page has been garbage-collected. You can pass primitive values, but I’ve had problems (a long long time ago, but still) with “Date” instances passed between frames.

    A trick you can pull is to call a function in the parent page to create your object from primitive values:

    // in parent:
    
    function newBar(what, ever) {
      return new bar(what, ever);
    }
    
    // in the frame page:
    
    parent.foo = parent.newBar("what", "ever");
    

    I think that’ll insulate you from problems, because the object will be allocated with the Object constructor on the parent page, and not the one in the frame page. In a former life the application I worked on was a vast sprawling thing involving a zillion iframes (for dialogs, warnings, all sorts of stuff). I had this problem all the time, and keeping things clean was painful enough that I’ve sworn off using iframes for that kind of stuff.

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

Sidebar

Related Questions

I'm using SVN (TortoiseSVN) and often came into the following situation: I wanted to
I'm in a situation where I came into a new job and I have
I recently came across this magical operator when digging into Groovy: <=> Groovy has
I came into matrix world from loop world (C, etc) I would like to
Since the GOF book was put together well before .Net came into being, are
I was experimenting jMock as my mocking framework for my project. I came into
I was doing some research into general topics of software engineering and I came
Came by a curious case today, that got me thinking about how the object
Whilst reading through the book The well grounded Rubyist, I came across some strange
I have a method which needs a Comparator for one of its parameters. I

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.