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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:51:52+00:00 2026-05-27T18:51:52+00:00

I’m doing a recursion through the whole tree of javascript objects available from the

  • 0

I’m doing a recursion through the whole tree of javascript objects available from the window global scope.

Its all fine and dandy in Chrome, Firefox and Safari but I’m having a bit of a problem in Internet Explorer.

Basically I’m building a stack of objects as I traverse through the tree, so I can check down the line of an object has been asigned in more than one place. For example I check.

var ignoreStack = [window, document]; // grows over time to contain every object

ignoreStack.contains = function(obj) {
  for(var i=0;i<this.length;i++) {
    if (this[i] === obj) {return true;} 
  }
  return false;
};

// ... further down the line inside a recursion
if (!(obj instanceof Object)) {return;}
for (var prop in obj) { 
  if (ignoreStack.contains(obj[prop])) {return;}
  ignoreStack.push(obj[prop]);
  recurse(obj[prop], prop);
}

Now the only problem is when it checks the following:

// Returns true in Chrome, Safari and Firefox
console.log(window.frames.frames === window.frames);
// Return false in IE

Every other object in the tree is equal to itself, however window.frames in IE seems to be the only exception where its not true to itself, so the recursion continues on as follows:

// window.frames.frames.frames.frames.frames ...etc

Does anyone have any idea why window.frames is not equal to itself?

I’ve tried doing some digging in google and debugging using IE Developer tools, all I can gather is that its an object of type DispHTMLWindow2 (not that that means much to me) and that (unlike in other browsers) its neither an Object nor an Array.

// Returns true in Chrome, Safari and Firefox
console.log(window.frames instanceof Object);
// Return false in IE

If somebody could shed some light on the reason why window.frames in IE behaves unlike any other javascript object (causing this type of infinite recursion) that would be much appreciated.

Thanks in advance.

  • 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-27T18:51:53+00:00Added an answer on May 27, 2026 at 6:51 pm

    Related question about other host objects that are not equal in IE

    If somebody could shed some light on the reason why window.frames in IE behaves unlike any other javascript object (causing this type of infinite recursion) that would be much appreciated.

    window.frames is a host object. Host objects are allowed to do whatever they please in ES3. IE is notorious for having highly misbehaving host objects. There is little you can do about it.

    I recommend you do the dirty hack which is a hard coded check for whether the key is 'frames' and the obj is window and ignoring the entire thing.

    There are another bunch of properties inside window.frames that also don’t behave.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I am reading a book about Javascript and jQuery and using one of the
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string

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.