Why can't get the Json pair value
The server servlet code is below(return to client);
JSONWriter jw = new JSONWriter(response.getWriter()); try { jw.array(); jw.object(); jw.key("result").value(result); jw.endObject(); jw.endArray(); } catch (JSONException e) { log.error("JSON Exception:", e); }And the client file JS in fold clientlibraryfold "xxx.js" not JSP page is below:
CQ.Ext.Ajax.request({ url: CQ.HTTP.externalize("/bin/customer"), method: "GET", success: function(response) { var info = response.responseText; alert(info);//[{"result":1}] var ack = info.result1;//undefined error alert(ack); }, failure: function(response) { } });So how to get the Key "result" value? I did try to use couple of way but fail. Anybody know that? Please comment it, thanks a lot.