在android 2.3.3中使用sencha touch的Ajax问题

时间:2011-09-16 14:56:13

标签: sencha-touch

我正试图在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 B S

1 个答案:

答案 0 :(得分:0)

为什么不使用Ext.data.Store?还可以尝试将params设置为查询字符串,并查看response.responseText是什么,即console.log(response.responseText);