I\'m doing an ios web app using Cordova
and JQuery
. I create the index.html which has a 3-row list view. when the row is clicked, the page will cha
check this example here, Hope it will help
http://wpcertification.blogspot.com/2012/05/using-jquery-mobile-in-phonegapcordova.html
https://stackoverflow.com/a/16497284/3169868 answers this well. For cordova+wp8, the option with LocalStorage is easy to implement.
If you want a value from one page to another you have few options (same rules apply for single jQM html with multiple page's and for jQM project built around multiple html files):
I. On the second page use pagebeforeshow and retrieve all needed data through a data object. Lets say you have 2 html files, first html has an id "page1" and second one has an id "page2"), example:
$('#page2').live('pagebeforeshow', function (e, data) {
alert(data.prevPage.find('div[data-role="content"]').attr('id'));
});
II. Second option is to create a shared object which will be used as data storage:
var storeObject = {
someValue : '1',
anotherValue : '2'
}
This is an easiest solution but it will only work while ajax page loading is active.
III. You can pass values with changePage:
$.mobile.changePage('page2.html', { dataUrl : "page2.html?paremeter=123", data : { 'paremeter' : '123' }, reloadPage : true, changeHash : true });
and read them like this:
$('#page2').live('pagebeforeshow', function (e, data) {
var paremeter = $(this).data("url").split("?")[1];;
paremeter = paremeter.replace("paremeter=","");
alert(paremeter);
});
If you want to learn more about this topic take a look at this article. You will find several solutions with examples.