Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share data between html pages

I want to send some data from one HTML page to another. I am sending the data through the query parameters like http://localhost/project/index.html?status=exist. The problem with this method is that data remains in the URL. Is there any other method to send the data across HTML pages using JavaScript or jquery.

like image 958
Muhammad Usman Avatar asked Jul 23 '12 09:07

Muhammad Usman


People also ask

How can I share data between two HTML pages?

So you can store (temporarily) form data between multiple pages using HTML5 storage objects which you can even retain after reload.. It was useful, thank you, but when trying to share multiple fields with variables('value'), it does not set values given from variables to items('label') between Web pages.


1 Answers

why don't you store your values in HTML5 storage objects such as sessionStorage or localStorage, visit HTML5 Storage Doc to get more details. Using this you can store intermediate values temporarily/permanently locally and then access your values later.

To store values for a session:

sessionStorage.setItem('label', 'value') sessionStorage.getItem('label') 

or more permanently:

localStorage.setItem('label', 'value') localStorage.getItem('label') 

So you can store (temporarily) form data between multiple pages using HTML5 storage objects which you can even retain after reload..

like image 100
Neji Avatar answered Sep 19 '22 00:09

Neji