Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have created a Cordova app in HTML5. I am trying to make an AJAX call in jQuery and calling with restAPI. It's working fine with Ripples but not working with android emulator 4.4.

I am using the code below:
JavaScript
var wcfServiceUrl = "http://dev3/DCLocalGateWay/LocalGateWay/RestGateWay.svc/GetMessage";
   $.ajax({      
        url: wcfServiceUrl,       
        type: "GET",
        contentType: "application/javascript; charset=utf-8",     
        crossDomain: true,
        dataType: "jsonp",
        async: false,
        error: function (error) {
            alert("Menu failed!");
            alert(error);
        },
        success: function (response) {
            alert(response.GetMessageResult);
        }

    });


Resource could not be loaded is the error I am getting when I call this in emulator or bluestack. While I am using ripples, its working fine. Our service returns JSON. I have already tried using $.getjson, XHR (XML HTTP Request). All methods give same error.

Any guidance would be greatly appreciated.

VM
Posted
Updated 21-Jul-15 21:01pm
v3
Comments
Kornfeld Eliyahu Peter 22-Jul-15 2:26am    
Do you have any error?
Vivek-Marwaha2015 22-Jul-15 2:33am    
Resource could not be loaded is the error I am getting when I call this in emulator or bluestack. While I am using ripples, its working fine. Our service returns JSON. I have already tried using $.getjson, XHR (XML HTTP Request). All methods give same error. Failed to load resource: net::ERR_NAME_NOT_RESOLVED

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900