persist value between two pages using javascript

hunt picture hunt · Mar 19, 2010 · Viewed 11.5k times · Source

i have a one html page in which i am storing few user selected values now and want to use these values on another html page.

i am using jquery in my module and i have already tried window.name and window.localStorage but they don't persist values between two pages.

so please help me to solve this problem.

Answer

carillonator picture carillonator · Mar 19, 2010

If you don't want a cookies--and if you're directing from the first page to the second, how about passing the values as GET variables to the next page:

http://example.com/newpage.html?var1=blah?var2=blerg

then you can access that data with window.location.search.