Click here to Skip to main content
13,043,865 members (46,593 online)
Rate this:
Please Sign up or sign in to vote.

I have an application where I am storing some values in javascript array and display the values in a table on html page. I have another html page where I need the same values so that I am trying to use the same array object to display the values but I am not sure is there any way to pass array object from one js to another js.
I also tried doing the same with local storage but the problem is same since local storage also works for the current page only.

If anyone knows how to handle this situation.

Posted 18-Mar-14 19:42pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This is not how Web works. Pages are pretty much independent. When a page is received from the server, it is executed on its own, only the page created by Javascrip can communicate with the parent page. If you got two different pages by two different HTTP responses, they are independent. They can communicate only indirectly, through some agent external to them. It could be database, or session states, normally, something which is done through the server. I'm not giving you any detail on that as you never mentioned that you are using any server-side technology.

SNI 19-Mar-14 2:09am
Thanks for your reply. We have few limitations bcoz we are using embeded version of linux so we are not able to use any server side scripting lang (e.g. php,ASP.Net...etc). We only have an option of shell script. But no idea how to use shell script to achieve this.
Sergey Alexandrovich Kryukov 19-Mar-14 10:27am
This is not reply, this is the final answer. You cannot communicate directly between two independent pages. If you explain you real, ultimate goal, you may have a chance to get some practical advice.
What shell script and how it can be related to HTML or Javascript? Do I miss something?
SNI 20-Mar-14 1:47am
nothing missed. Thanks for your answer.
Sergey Alexandrovich Kryukov 20-Mar-14 10:38am
Sure. Will you accept it formally?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 19 Mar 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100