Javascript XMLHttpRequest无法加载No';访问控制是否允许原点';? $(“#urlform”).submit(函数(事件){ $.mobile.load('show'); event.preventDefault(); 罗吉努尔(“d”,“d”,“00:1C:B3:09:85:15”,“Ekse”) $.mobile.load('hide'); }); var productServiceUrl=”http://someip/CaliberLIMS/Service1.asmx?op=UserLoginSts"; 函数loginurl(用户名、pswd、MacAddre、otherInfo){ var soapMessage= '' + +'' + '' + ''+用户名+''+ ''+pswd+''的+ ''+MacAddre+''+ ''+其他信息+''+ '' + '' + ''; $.ajax({ url:productServiceUrl, 类型:“POST”, 数据类型:“xml”, 数据:soapMessage, 完成:endSaveProduct, contentType:“text/xml;字符集=\“utf-8” }); 返回false; } 函数endSaveProduct(xmlHttpRequest,状态){ log(xmlHttpRequest.responseXML); }
我已经允许在服务器上进行跨脚本操作,但是如果我在代码中出错,那么这个请求仍然不起作用 编辑:Javascript XMLHttpRequest无法加载No';访问控制是否允许原点';? $(“#urlform”).submit(函数(事件){ $.mobile.load('show'); event.preventDefault(); 罗吉努尔(“d”,“d”,“00:1C:B3:09:85:15”,“Ekse”) $.mobile.load('hide'); }); var productServiceUrl=”http://someip/CaliberLIMS/Service1.asmx?op=UserLoginSts"; 函数loginurl(用户名、pswd、MacAddre、otherInfo){ var soapMessage= '' + +'' + '' + ''+用户名+''+ ''+pswd+''的+ ''+MacAddre+''+ ''+其他信息+''+ '' + '' + ''; $.ajax({ url:productServiceUrl, 类型:“POST”, 数据类型:“xml”, 数据:soapMessage, 完成:endSaveProduct, contentType:“text/xml;字符集=\“utf-8” }); 返回false; } 函数endSaveProduct(xmlHttpRequest,状态){ log(xmlHttpRequest.responseXML); },javascript,web-services,soap,Javascript,Web Services,Soap,我已经允许在服务器上进行跨脚本操作,但是如果我在代码中出错,那么这个请求仍然不起作用 编辑: 获取上述错误。是否尝试使用数据类型:“jsonp”?检查要尝试此操作,您需要将数据类型更改为dataType:'jsonp',,并在URL的末尾添加&callback=?刚刚更新了我的问题 $("#urlform").submit(function(event) { $.mobile.loading('show'); event.preventDefault(); loginu
获取上述错误。是否尝试使用数据类型:“jsonp”?检查要尝试此操作,您需要将数据类型更改为
dataType:'jsonp',
,并在URL的末尾添加&callback=?
刚刚更新了我的问题
$("#urlform").submit(function(event) {
$.mobile.loading('show');
event.preventDefault();
loginurl("d", "d", "00:1C:B3:09:85:15", "Ekse")
$.mobile.loading('hide');
});
var productServiceUrl = "http://someip/CaliberLIMS/Service1.asmx?op=UserLoginSts";
function loginurl(UserName, pswd, MacAddre, otherInfo) {
var soapMessage =
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
+'<soap:Body>' +
'<UserLoginSts xmlns="http://Caliberindia.com/webservices/">' +
'<UserName>' + UserName + '</UserName>' +
'<pswd>' + pswd + '</pswd>' +
'<MacAddr>' + MacAddre + '</MacAddr>' +
'<OtherInfo>' + otherInfo + '</OtherInfo>' +
'</UserLoginSts>' +
'</soap:Body>' +
'</soap:Envelope>';
$.ajax({
url: productServiceUrl,
type: "POST",
dataType: "xml",
data: soapMessage,
complete: endSaveProduct,
contentType: "text/xml; charset=\"utf-8\""
});
return false;
}
function endSaveProduct(xmlHttpRequest, status) {
console.log(xmlHttpRequest.responseXML);
}