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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:11:27+00:00 2026-06-13T01:11:27+00:00

This may sound ridiculous but there are some situations when we need to share

  • 0

This may sound ridiculous but there are some situations when we need to share JavaScript Objects across iframe.

When we try to use localStorage for serving the purpose, people say that some browsers might not support it.Even if they support localStorage, Users might’ve reduced the storage capacity and so forth…
So my question is, Do we have a Solution/Alternative to share JavaScript Objects across iframe
Below example might get us on the same page

parentpage.html

<html>
...
<head><script src="script1.js" type="text/Javascript"></script></head>
<body>
...
<iframe src="childpage.html"></iframe>
</body>
</html>

childpage.html

<html>
...
<head><script src="script2.js" type="text/Javascript"></script></head>
...
</html>

note:
parentpage.html , childpage.html, script1.js, script2.js reside in the same domain and in the same location

Assume that script1.js uses a JavaScript Object that needs to be made publicly available.

Since the browser/UserAgent creates a separate Window Object for each additional iframe used in the page and we can’t access the Public JavaScript Object if we attach/Extend it to the Window Object/Document Object, The Last hope of it seems to fade away!

Is there any Solution/Workaround?

  • 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-13T01:11:28+00:00Added an answer on June 13, 2026 at 1:11 am

    As @Pointy Suggested, the best Alternative to LocalStoage for sharing data across frames is to use window.top Property/Member/Object

    But still, the Property is ReadOnly as mentioned in mozilla dev docs but I still wonder if it’s not in anyway forced strictly in the future not to add new Member/Field to window.top

    Refer: Mozilla Dev Docs

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

Sidebar

Related Questions

This may sound ridiculous but I need to send something like <policy-file-request/> followed by
This may sound like a newbie question, but I really need some help with
OK, it may sound ridiculous but this is what happened : I've set up
This may sound strange, but I need a better way to build python scripts
This may sound like a strange question, but hopefully there is an answer out
This may sound impossible but read on. I need to learn jQuery a little
this may sound too simple, but I'm missing something. I need to write a
This may sound stupid, but is there a way to open terminal and execute
This may sound like a weird question but is there any where I can
This may sound like a very basic question to some of you but 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.