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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:51:54+00:00 2026-05-23T09:51:54+00:00

So the following code alerts false twice: window.onload = function(){ alert(window.myframe.myarray instanceof Array); alert(window.myframe.myarray.constructor

  • 0

So the following code alerts false twice:

window.onload = function(){
                    alert(window.myframe.myarray instanceof Array);
                    alert(window.myframe.myarray.constructor === Array);
                }

When there’s an iframe in the page named “myframe” that has contains an array called “myarray”. If the array is moved into the main page (as opposed to the iframe), then the code alerts true twice as expected. Does anyone know why this is?

  • 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-23T09:51:55+00:00Added an answer on May 23, 2026 at 9:51 am
    function isArray(o) {
      return Object.prototype.toString.call(o) === '[object Array]';
    }
    

    Long explanation here about why .constructor fails with frames.

    The problems arise when it comes to scripting in multi-frame DOM environments. In a nutshell, Array objects created within one iframe do not share [[Prototype]]’s with arrays created within another iframe. Their constructors are different objects and so both instanceof and constructor checks fail:

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

Sidebar

Related Questions

I have the following code block : function testJQueryClick(){ $('#button2').click(function(){ alert ('Debug'); return false;
I tried the following code to get an alert upon closing a browser window:
i'm using the following code to submit a form: function submitfilter(){ alert(in here); var
The following source code alerts the following results: Internet Explorer 7 : 29 Firefox
Following code, when compiled and run with g++, prints '1' twice, whereas I expect
if wrote the following code and do not understand why the trace returns false:
I have the following code: jQuery: $.ajax({ url: '/personcontroller/getperson', cache: false, type: POST, data:
I tested the following code in FF 3.6 and IE 8. The former alerts
I have the following code to set the src of an iFrame alert(this.options.url); this.iframe.src
I have the following code (function($) { // carousel var Carousel = { settings:

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.