Click here to Skip to main content
15,889,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

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.

Regds
SNI
Posted

1 solution

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.

—SA
 
Share this answer
 
Comments
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?
—SA
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?
—SA

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900