Rana Muhammad Usman Rana Muhammad Usman - 6 months ago 58
HTML Question

Passing data between html pages

I want to send some data from one html page to another. I send it through URL nad capture it on other page as..

. on the basis of this data java script has to display message. but the problem is after recieving this this data whenever I refresh the page it captures the same data again and displays message. I dont want to do this every time. How it can be resolved or is there any other method to send data across html pages using JavaScript or jquery etc


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')

or more permanently:

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

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