Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot Make AJAX Call in Google Ripple PhoneGap Emulation (500 Error)

I'd add a comment here:

PhoneGap application not working on Google Ripple

but given my low reputation on StackOverflow (as elsewhere), I can't. That thread raises similar issues but does not answer my question. I am trying to test the functionality of an HTML5 page that will eventually be made into a mobile app with PhoneGap. The page makes an AJAX call to a JSON service via jQuery:

$(document).ready(function() {
        $.ajax({
            url: 'latest.json',
            type: 'get',
            datatype: 'json',
            processData: false,
            success: function(data) {
            //…make it so
    });
});

and runs flawlessly as HTML5 in Chrome. However, when using the Ripple PhoneGap emulation available for Chrome, the JSON fails with a 500 error:

GET https://rippleapi.herokuapp.com/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rurl=latest.json 500 (Internal Server Error) rippleapi.herokuapp.com/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rurl=latest.json:1

The suggested answer to the question linked above reads:

I had the same issue. It was happening when I was trying to connect to my WebAPI service hosted on IISExpress.

After I changed hosting to my local IIS server, the error dissapeared (sic) and I was able to connect to my WebAPI service using Ripple.

But I'm not running IIS or indeed anything locally -- it's all running off a remote server hosted by an ISP. Since, as I say, this page runs fine in non-emulation mode, the fault would appear to be in Ripple. Any help making this emulation operate correctly will be greatly appreciated.

like image 376
jimiayler Avatar asked Jan 17 '14 17:01

jimiayler


1 Answers

 $.ajax({
         type: "GET",
         url: serviceurl + "/GetBusinessPartner/",
         dataType: "json",
         crossDomain: true,
         success: function (responseData) {
         },
         error: function (xhr) {
         }
   });

This worked for me and in ripple setting disable cross domain proxy.

like image 191
Amit Avatar answered Oct 09 '22 22:10

Amit