XMLHttpRequest在cordova 3.3中不起作用
我正在使用web服务(SOAP)来使用来自外部源的数据 我能够使用EclipseWeb浏览器获得响应,但不能在Android设备和模拟器中工作(我得到0作为响应)XMLHttpRequest在cordova 3.3中不起作用,cordova,Cordova,我正在使用web服务(SOAP)来使用来自外部源的数据 我能够使用EclipseWeb浏览器获得响应,但不能在Android设备和模拟器中工作(我得到0作为响应) var xmlhttp=new XMLHttpRequest(); xmlhttp.open('POST','http://hmecd000910/ClubdService/ClubDSecurityService.svc",对),; var sr=''+ ''+ ''+ ''+ 'nc@usl.com'+ ''+ ''+
var xmlhttp=new XMLHttpRequest();
xmlhttp.open('POST','http://hmecd000910/ClubdService/ClubDSecurityService.svc",对),;
var sr=''+
''+
''+
''+
'nc@usl.com'+
''+
''+
'';
xmlhttp.onreadystatechange=函数(){
if(xmlhttp.readyState==4){
警报(xmlhttp.status+'--'+xmlhttp.readyState);
如果(xmlhttp.status==200){
警报(xmlhttp.responseText);
}
//警报(xmlhttp.responseText);
}
}
setRequestHeader('Content-Type',“text/xml;charset=\“utf-8\”);
setRequestHeader('Content-length',sr.length);
setRequestHeader('SOAPAction','http://tempuri.org/IUSLClubDSecurityService/GetUserByUserEmail');
xmlhttp.send(sr);
我已经按照以下方式配置了config.xml
<access origin="*" />
他们尝试以下代码
$.post( ipAddress +"/acb.php", { user_id:userID,password:pwd} , function( data ) {
if(data.status==true){
//response
}
},"json");
$.post( ipAddress +"/acb.php", { user_id:userID,password:pwd} , function( data ) {
if(data.status==true){
//response
}
},"json");