I am new for PhoneGap
I want to develop my phonegap android application.
I have try to no of time but not become success so if have knowledge for "Access Web Service of PHP in JavaScript which will give response in Json"
If any one idea about how to handle (parse) web service response of Json String in java script???...
Please Help me...
-
why you want to handle this because it seems you want to do something with form post methodMayank K. Swami– Mayank K. Swami2012年05月01日 10:28:05 +00:00Commented May 1, 2012 at 10:28
2 Answers 2
Please write down below Jquery code in your phonegap pages.
$(document).ready(function() {
$("#submit").click(function(){
var formData = $("#formId").serialize();
$.ajax({
data:formData,
url: 'http://urlname.com/webapi.php',
dataType: "jsonp",
jsonpCallback: "onSuccess"
});
return false;
});
function onSuccess(data, status)
{
$("#divId").text($.trim(data.result));
}
}
Look at AJAX. To be honest, you've not given us much to go on as we don't know what you've already tried and what your experience is. Some examples of your previous attempts would be useful.