Can I use jQuery AJAX calls in PhoneGap to run a PHP file that gets records from a database, or should I use JavaScript AAJAX?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You certainly can use jQuery Ajax functions in your PhoneGap applications. Here is a demo:
— JavaScript in App —
— PHP on Server —
The above example will query the PHP script on the server every time the ‘#some_page_id’ page is shown and append the data grabbed to the
<div data-role="content">tag. You can also use.html(data)instead of.append(data)to replace the HTML rather than add to it.UPDATE
I found this in the jQuery Mobile documentation which gives some excellent information about making
$.ajax()calls in PhoneGap apps: http://jquerymobile.com/demos/1.0/docs/pages/phonegap.html