Sencha在iPhone模拟器中解析JSON,但不支持iPhone - phonegap

问题描述:

我在Sencha Touch App中解析了来自服务器的JSON响应中的以下代码。该应用被封装在Phonegap中,并被部署为本机应用苹果手机。此代码在iPhone模拟器上正常工作,但不在iPhone上。Sencha在iPhone模拟器中解析JSON,但不支持iPhone - phonegap

有一个类似的问题已经四处漫游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 
}); 

任何帮助将非常感激。

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

的小东西,大的影响。

谢谢!