无法在"xmlhttprequest"上执行“发送",无法加载 [英] Failed to execute 'send' on 'xmlhttprequest' failed to load
问题描述
大家好,当我尝试运行在DevExtreme中创建的应用程序时,出现标题中提到的错误.
Hello guys I'm getting the error mentioned in the headline when i try to a run my app created in DevExtreme.
每当Í在DevExtreme模拟器中运行我的应用程序时,它便会正常运行,但是当我尝试在手机上运行该应用程序时,我会遇到上述错误.
Whenever Í run my app in the DevExtreme simulator it works as it should but when I try to run the app on my phone I get the mentioned error.
function CallService() {
var baseAddress = "http://192.168.80.2:8080/WebService/rest/WarehouseServices/";
$.ajax({
type: "GET",
url: baseAddress + 'getPickingOrders',
contentType: 'applicaiton/xml; charset=utf-8',
dataType: "xml",
async: false,
success: function (xmlObject) {
xml = xmlObject;
console.log("succes ramt");
alert(xml);
console.log(xml);
dataSource = GetData(xmlObject);
},
error: ErrorOccur
});
}
很长一段时间以来,我一直在努力解决这个问题,但我没有主意.
I have been strugling with this problem for a long time now and I'm out of ideas.
推荐答案
如果运行此脚本的页面不在 http://192.168.80.2:8080
上,而您的服务器不在启用跨源资源共享的源头,您就遇到了相同起源政策,该政策禁止跨域ajax.
If the page where this script is running isn't on http://192.168.80.2:8080
and your server doesn't enable Cross-Origin Resource Sharing for whatever origin it's on, you're running into the Same Origin Policy, which prohibits cross-origin ajax.
这篇关于无法在"xmlhttprequest"上执行“发送",无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!