使用Ext.decode()解析JSON字符串时firebug提示extjs missing ] after element list错误

使用Ext.decode()解析JSON字符串时firebug提示extjs missing ] after element list的错误,我的代码如下:

var requestConfig = { url:'/module/dati/backend/processQuestion.jsp', form:myFormPanel.getForm().id, callback:function(options,success,response){ var responseJson = Ext.util.JSON.decode(response); if(responseJson.success == false){ alert("答题错误"); } } }; Ext.Ajax.request(requestConfig);

注意我在执行Ext.util.JSON.decode(response);时调用了错误的参数,

response是返回的The XMLHttpRequest object containing the response data.而不是字符串类型,

改成var responseJson = Ext.util.JSON.decode(response.responseText);就对了


你可能感兴趣的:(json,list,Firebug,XMLhttpREquest,ExtJs,callback)