Click here to Skip to main content
11,805,316 members (66,449 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Javascript HTML jQuery

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 at 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 at 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 at 20-Mar-14 1:47am
nothing missed. Thanks for your answer.
Sergey Alexandrovich Kryukov at 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
0 OriginalGriff 315
1 Sergey Alexandrovich Kryukov 200
2 Richard Deeming 200
3 CPallini 160
4 CHill60 150
0 OriginalGriff 3,265
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 19 Mar 2014
Copyright © CodeProject, 1999-2015
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