2011-09-16 88 views
0

我想在sencha觸摸框架中使用Ajax檢索交互數據。在android 2.3.3中使用sencha觸摸的Ajax問題

  I am sending Ajax request like 

      Ext.Ajax.request 
      ( 
       { 
        url  : 'xxx../xxx.json', 
        method : 'GET', 
        params : 
        { 
        startDate : 'xxx', 
        endDate : 'xxx' 
        } 
        success: function(response,opts) 
        { 
        var response = Ext.decode(response.responseText);     
        } 
       } 
      ) 
     This works good in Chrome and retrieving the data.But when I tried in Andriod 2.3.3 I am getting the following error : "SyntaxError : Unable to parse JSON string" 

      The error occurs in the sencha touch framework on line 14583,which is 

      Ext.util.JSON = 
      { 
       encode : function(o) 
        { 
         return JSON.stringify(o); 
        }, 
       decode : function(s) 
        { 
         return JSON.parse(s); 
        } 
       }; 

     Can anyone help how to resolve this? 

     Thanks in advance. 

感謝&問候

Gayathri乙小號

回答

0

你爲什麼不使用Ext.data.Store?還可以嘗試將參數設置爲查詢字符串並查看response.responseText是什麼,即console.log(response.responseText);