1

Possible Duplicate:
jQuery mobile passing parameter from one page to another

I need to pass values from one page html to another html page. what is the best way to pass the value. can anyone explain me how to achieve this.

Community
  • 1
  • 1
sachi
  • 2,122
  • 7
  • 30
  • 46

2 Answers2

3

you can pass the variables through forms, urls and session. You can use all the methods you use in existing web applications to pass data from 1 page to another. or you can utilize the local storage of HTML5 which is a modern and faster way of storing the secure data

localStorage.lastname="Smith";
document.getElementById("result").innerHTML="Last name: "+ localStorage.lastname;

You can find more information about HTML5's local storage on the following link

http://www.w3schools.com/html5/html5_webstorage.asp

Faizan Ali
  • 509
  • 12
  • 35
1

You can use the html5 local or session storage api to store the small data across the pages.

To set the value on session storage

window.sessionStorage.setItem('key', 'value');

and to get the value

sessionStorage.getItem('key');

Talha
  • 18,898
  • 8
  • 49
  • 66