user5396725
user5396725

Reputation:

Failed to execute 'send' on 'xmlhttprequest' failed to load

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.

Upvotes: 4

Views: 27693

Answers (1)

T.J. Crowder
T.J. Crowder

Reputation: 1075367

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.

Upvotes: 1

Related Questions