I have developed a sample app on Android using Phonegap.
When clicked on a button, an Ajax request is made to the server (http://192.168.0.199:8080/test.php).
The test.php just echoes hello world.
I am using Jquery 1.5 for making the Ajax call.
Here is the code for the Ajax call:
$.ajax({
url:"http://192.168.0.199:8080/test.php",
beforeSend: function(x) {
alert("The URL "+url);
},
type: POST ,
crossDomain: true,
success:function(data) {
alert(data);
},
error:function(XMLHttpRequest,textStatus, errorThrown) {
alert("Error status :"+textStatus);
alert("Error type :"+errorThrown);
alert("Error message :"+XMLHttpRequest.responseXML);
}
});
但是,每次要求行使这一职能时,它都会犯以下错误:
Error Type: No Transport
Error Message: undefined
Error Status: error
www.un.org/Depts/DGACM/index_spanish.htm 注:我在Manifest案卷中增加了Internet Permission。 我使用的是1台G1装置,带有1.6张。
预 收