Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass a string value from one html to another (Phonegap)

Im new to Html language and I am trying to develop a PhoneGap App with it, I want to have 4 options in my main menu(index), and depending on what option the user taps load specific data from an xml. In order to load that specific data, I need to save a string that distinguish the option choose by the user and helps me find data in the xml.

How can I do this? I also heard something about some memory PhoneGap provides for this cases, couldn't find anything though, Thanks!

like image 241
Golan_trevize Avatar asked Feb 17 '23 16:02

Golan_trevize


1 Answers

we pass values from one page to another with localStorage

/* Page A */
window.localStorage.setItem("id", "stringValue");

/* Page B */
var stringValue = window.localStorage.getItem("id");
like image 157
最白目 Avatar answered Feb 23 '23 18:02

最白目