【问题标题】:Sencha parses JSON in iphone simulator, but not on iPhone - phonegapSencha 在 iPhone 模拟器中解析 JSON,但在 iPhone 上不解析 - phonegap
【发布时间】:2011-12-31 21:23:13
【问题描述】:

我在 Sencha Touch 应用程序中有以下代码,它解析来自服务器的 JSON 响应。该应用程序被包裹在 Phonegap 周围,并作为 iPhone 上的本机应用程序部署。此代码在 iPhone 模拟器上运行良好,但在 iPhone 本身上运行良好。

有一个类似的问题已经在 SO 周围漫游,没有答案:json not loading in iphone device while using sencha touch and phonegap

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
});

任何帮助将不胜感激。

【问题讨论】:

    标签: iphone ios cordova extjs sencha-touch


    【解决方案1】:

    因此,我们设法修复了错误...服务器是自定义构建的,并且在响应标头中响应 HTTP/1.0,而我们需要 HTTP/1.1

    小事,大影响。

    谢谢!

    【讨论】:

      猜你喜欢
      • 2010-12-17
      • 2011-08-26
      • 1970-01-01
      • 2012-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多