javascript - PhoneGap (web mobile app) - Transfer data between pages -
i'm developing phonegap application. if don't know is, it's service allows build mobile-based applications using html, css , javascript.
i have application, , i've come point need transfer information 1 page another. user chooses option on page, application loads new page , based on option loads specific content.
now know few ways of doing this, name one.. local storage maybe. question is, efficient way of getting information between these 2 pages? if php i'd using $_get[''].. it's not php, i'm looking best way using html, css, , javascript.
any here highly appreciated!
there several possibilities:
you using service phonegap:build or cordova: gonna have 1 html-file continously hide , show different pages. don't recommend one, phonegap:build , cordova great create package major phones, without headache.
url-parameters pass parameter on url different html-page. means have open links
window.location.replace()or changehref-attribute on anchors. in next page have parse url, not easy in php.localstorage / sessionstorage can store data in sessionstorage.
sessionstorage.myobject = json.stringify(complexobject)can store complex objects session storage , read themvar complexobject = json.parse(sessionstorage.myobject). available during complete session , 1 of easiest solutions far.
Comments
Post a Comment