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

1

12

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.

Anklebone answered 17/1, 2014 at 17:18 Comment(1)
I added an answer to the question that you referenced above. You may want to check and see if it also answers your question https://mcmap.net/q/1012631/-phonegap-application-not-working-on-google-rippleSylvester
S
2
 $.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.

Stoner answered 7/9, 2015 at 10:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.