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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:20:43+00:00 2026-06-17T10:20:43+00:00

In order to pass data between windows, I open new windows via the window.open

  • 0

In order to pass data between windows, I open new windows via the window.open method and set a property of the newly opened window to an object. This allows me not only to pass data, but to share the instance of the variable, meaning if I modify the object, or any of its derived properties, on one window, it modifies it on all windows.

The problem, however, is something is going very funny with the instanceof operator.

When I do

typeof m
m instanceof Object

The first line returns "object" while the second one returns false.

I specifically need the instanceof operator to check between arrays and objects.

Here is a fiddle of an example (WARNING: tries to open a window on page load, so a popup blocker might block it). http://jsfiddle.net/Chakra/mxf2P/1/

  • 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-17T10:20:44+00:00Added an answer on June 17, 2026 at 10:20 am

    Since your window’s Object and the source window’s Object aren’t the same thing, an instance of one won’t be an instance of the other. You can use Object.prototype.toString to distinguish between objects and arrays:

    if(Object.prototype.toString.call(m) === '[object Array]') {
        // It's an array
    } else {
        // It's not
    }
    

    You can also use Array.isArray, if available.

    Here’s a demo. (It uses an <iframe> instead of a popup, by the way.)

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

Sidebar

Related Questions

Whats the best way to pass data to jQuery AJAX Get method via PHP.
I'm trying to pass data between 2 Action classes. I'm currently doing this In
In order to pass array variables via my curl script, I am using serialize
In order to pass data back to activity from service, I came to know
I am new to MVC. i have problem to pass data from view to
I am using .htaccess code in order to pass pages titles to the url
Anybody knows how to print single-linked list in reverse order (one pass and a
I'm using python-spidermonkey to run JavaScript code. In order to pass objects (instead of
in order to 'feed' a .NET web service from java I do pass xml
I need to pass objects in ajax request in order to "PUT" files or

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.