我在本地环境
url 上创建了 php web 服务:
http://localhost:5454/kisan-06/index.php?option=com_api&format=raw&app=users&resource=login&key=dfd8a84f8cdce807ae1d30a838415ea37eaa075c
我在我的 android phonegap 应用程序中使用 jQuery.ajax 调用它。
Ajax 调用是:
$.ajax({
type: "POST",
url: "http://localhost:5454/kisan-06/index.php?option=com_api&format=raw&app=users&resource=login&key=dfd8a84f8cdce807ae1d30a838415ea37eaa075c",
data: "{ username: 'sai.kiks2@gmail.com', password: '123456'}",
contentType: "application/json; charset=utf-8",
cache : false,
dataType: "json",
success: function(data) {
alert("in success");
},
error: function(){
alert("There was an error loggin in");
}
});
每次调用错误回调,我都无法跟踪错误。请帮助我。