无法在Google Ripple PhoneGap仿真中进行AJAX调用(500错误)

jim*_*ler 12 ajax json google-chrome ripple cordova

我在这里添加评论:

PhoneGap应用程序无法在Google Ripple上运行

但鉴于我在StackOverflow上的声誉很低(和其他地方一样),我不能.该线程提出了类似的问题,但没有回答我的问题.我正在尝试测试HTML5页面的功能,该页面最终会被制作成使用PhoneGap的移动应用程序.该页面通过jQuery对JSON服务进行AJAX调用:

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

并在Chrome中以HTML5完美运行.但是,当使用适用于Chrome的Ripple PhoneGap模拟时,JSON会因500错误而失败:

获取https://rippleapi.herokuapp.com/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rurl=latest.json 500(内部服务器错误)rippleapi.herokuapp.com/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rurl=latest.json:1

上面提到的问题的建议答案如下:

我遇到过同样的问题.当我尝试连接到IISExpress上托管的WebAPI服务时,就发生了这种情况.

在我将托管更改为本地IIS服务器之后,错误消失了(原文如此),并且我能够使用Ripple连接到我的WebAPI服务.

但是我没有在本地运行IIS或其他任何东西 - 它都是由ISP托管的远程服务器运行的.因为,正如我所说,这个页面在非仿真模式下运行正常,故障似乎是在Ripple中.任何有助于使此仿真正常运行的帮助将不胜感激.

小智 2

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

这对我有用,并且在波纹设置中禁用跨域代理。