admin管理员组文章数量:1400445
Hello guys I'm getting the error mentioned in the headline when i try to a run my app created in 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.
Hello guys I'm getting the error mentioned in the headline when i try to a run my app created in 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.
Share Improve this question asked Apr 5, 2016 at 8:17 user5396725user5396725 7-
async: false
Why? Why? It makes for a horrible UX. – T.J. Crowder Commented Apr 5, 2016 at 8:21 - We could use more context. Where is this code running? The other SO questions I see with this specific error message talk about the code being part of a Chrome extension -- is that the case here? – T.J. Crowder Commented Apr 5, 2016 at 8:23
- The code is running in a framework called DevExtreme which also able to simulate the code as it would be a a mobile phone. I'm not sure what you mean about being a party of a Chrome extension. The app is only giving this error when running on my phone and not in the simulator – user5396725 Commented Apr 5, 2016 at 8:38
-
Re
async: false
: Sure it will, you just need to use the callback correctly. – T.J. Crowder Commented Apr 5, 2016 at 8:47 -
1
Look at just about any example of using
ajax
. The key thing is to use the result from within thesuccess
callback, not to do it in code following theajax
call. – T.J. Crowder Commented Apr 5, 2016 at 9:12
1 Answer
Reset to default 1If 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.
本文标签: javascriptFailed to execute 39send39 on 39xmlhttprequest39 failed to loadStack Overflow
版权声明:本文标题:javascript - Failed to execute 'send' on 'xmlhttprequest' failed to load - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744219987a2595819.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论