How to decode json response in ExtJs

by admin on February 20th, 2012

//when json response is in this format {“success”:true,”data”:{“id”:11}}
Ext.Ajax.request({
url:’connect.php’,
params:{moduleId:moduleId, status:’insert’,activity:’save’,action:’doAction’},
success:function(res){
var response = Ext.util.JSON.decode(res.responseText);
alert(response.data.id);
}
});

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>