0

Currently I'm working on phone gap project. I have one html file containing all pages for my iPhone app. I want to pass data between pages. So which way will work efficiently:

  1. using submit button, on submit I will pass data and can access on another page;
  2. using jam-page-params plugin;
  3. using localStorage.
tutankhamun
  • 880
  • 2
  • 11
  • 21
Vaishali Modi
  • 654
  • 1
  • 5
  • 17
  • local storage is a better option – Sheetal Sep 06 '13 at 05:16
  • Thank you for quick reply but please give me the reasons for using local storage – Vaishali Modi Sep 06 '13 at 06:47
  • http://stackoverflow.com/a/14469041/1848600 Read chapter: Data/Parameters manipulation between page transitions. If you have one HTML page containing all pages best solutions are: 1. Create a global javascript object and share data 2. Pass data between pages (you don't need plugin for that, just look at an example in my previous answer) 3. Localstorage. Localstorage is slowest solution, use it only if you want to have persistent data, basically if you want to load your data every time app is active. – Gajotres Sep 06 '13 at 06:52
  • I am not sure if the app goes in background and you return back and then perform navigation then also passing values via a global variable or your 2 option works, if it does then well its great, but we have created an extensive phonegap app where we prefer storing these smaller values in device using jStorage which is persisted and app doesn't loose any of its data. Its efficient unless you are exploiting it to store huge data. – Sheetal Sep 06 '13 at 08:41
  • I have started implementation of my work using localStorage. but as i have referred the performance quality of jStorage vs localStorage then as per following link localStorage is better. http://jsperf.com/pure-localstorage-vs-cookie-vs-jstorage-js-vs-hash but as m not aware about the case when my app goes in background, i can't make any conclusion. Once again thanks for your guidance. – Vaishali Modi Sep 06 '13 at 12:04

0 Answers0