I'm working on a mobile app on phonegap, and I need to pass variables between pages exactly like : http://coenraets.org/apps/directory/jqm/index.html
but my problem is that I can't use a php file. How can I do that ? Thank you :)
I just tried the LocalStorage which is mentionned here : http://docs.phonegap.com/en/1.6.1/cordova_storage_storage.md.html#localStorage but it doesn't work : here's my code :
Page1 :
$(data).find("Book").each(function () {
var temp = $(this).find("name").text();
var temp1 = $("#champ").val().replace(" ", "") ;
if (temp1 != "") {
if (temp.toLowerCase().search(myRegExp) > -1) {
$("#result_list").append("<li><a href='recherche_details.html' data-transition='pop'><img src='images/a.jpg' /><p><strong>Titre : " + temp + "</strong></p><p>Auteur : " + $(this).find("address").text() + "</p><p>Pays : " + $(this).find("country").text() + "</p></a></li>").listview("refresh") ;
$envoi_search.attr("disabled", "");
// Using the LocalStorage
window.localStorage.setItem("titre" + i, temp);
i++ ;
}
}
});
Page2 :
<script type="text/javascript" charset="utf-8">
// Wait for Cordova to load
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
function onDeviceReady() {
// keyname is now equal to "key"
var value = window.localStorage.getItem("titre0");
$("#result").append("Yoooo" + value + " !! you are here") ;
}
</script>
but it doesn't work. Do you have any idea ?