-->

煎茶JSON解析在iPhone模拟器,但不是在iPhone - 的PhoneGap(Sencha

2019-09-28 19:38发布

我有一个煎茶触摸应用程序下面的代码解析从server.The应用JSON响应围绕PhoneGap的包装和部署为在iPhone本机应用程序。 此代码工作正常在iPhone模拟器,但不是在iPhone本身。

有一个类似的问题已经四处漫游SO,解答: JSON在使用煎茶触摸和PhoneGap的在iPhone设备不加载

Ext.Ajax.request({
    url: makeurl,    //'http://hostname/index.php?id=1234&action=STARTLIST&cmd=0',
    scope : this,
    success: function(response){
        GoRemote.views.devicelist.setLoading(false);
        GoRemote.serverstatus="Ok";
        Ext.getCmp('serverstatuspanel').update('Server Status : Okay');
        this.listData = Ext.decode(response.responseText);
        console.log(response);
        if (this.listData.listresponse) {
            GoRemote.stores.RoomDeviceListStore.loadData(this.listData.listresponse.listdata, false);
            GoRemote.views.toolbar.setTitle(this.listData.listresponse.listinfo.listname);
              if(this.listData.listresponse.listinfo.container){
                  Ext.getCmp('btnBack').setVisible(true);
              }
              else{
                  Ext.getCmp('btnBack').setVisible(false);
              }
        }  
        else if(this.listData.listcontrol){
            if(this.listData.listcontrol.controlinfo.name=="NIAVDevice"){
                Ext.getCmp('navigation').setActiveItem(0);
            }
        }  
    },
    failure:function(response){
        GoRemote.serverstatus="Unable to reach director";
        Ext.getCmp('serverstatuspanel').update('Server Status : Unable to reach director');
        GoRemote.views.devicelist.setLoading(false);
    }
  //  timeout:20000
});

任何帮助都感激不尽。

Answer 1:

所以,我们设法修正这个错误...服务器是一个定制的,并在响应头与HTTP响应/ 1.0,我们需要有HTTP / 1.1

小东西,大的影响。

谢谢!



文章来源: Sencha parses JSON in iphone simulator, but not on iPhone - phonegap