I am creating a mobile app using jquery mobile, PHP using JSON for fetching the data and PhoneGap to convert to a native App for iOS, Andorid, BB ext. The problem i have is that i want to create dynamic pages but using only AJAX and JQuery Mobile pages because otherwise i cannot create a native app. The problem that i have for the moment is that i want to create dynamic pages for example i fetch all the news titles and display them using a list-view
and then after tapping the title of the news i want to display a page of the full news just likestandford has done the events page http://m.stanford.edu/#events/e/?i=31633
You cannot use PHP pages (or aspx, etc.) with Phongap, they have to be HTML, because you cannot run server-side code within Phonegap. That being said, you can accomplish the dynamic behavior by fetching your data from an external server with ajax calls.
This page in the documentation talks about using dynamic JSON data to build pages:
http://jquerymobile.com/demos/1.1.0-rc.1/docs/pages/page-dynamic.html
The stanford demo seems to be using a multi-page template discussed here, not dynamic JSON data:
http://jquerymobile.com/demos/1.1.0-rc.1/docs/pages/multipage-template.html
$.getJSON('URL_TO_FILE.php', function(data) {
$.each(data['cotegory'], function(i,row){ var title = row.title; var content = row.content; $('#newslist').append('
});
}) - Agli Panci 2012-04-04 20:05