PDA

View Full Version : Ajax response to json?



trandroid
6 Jul 2010, 5:49 AM
hi,

I'm getting response from Ajax request but i dont know how to convert response.responseText to json.

var getNews = function(news_type) {
Ext.Ajax.request({
url: 'data/freenews.json',
success: function(response) {

alert("Json String : "+ response.responseText);
// Up to now everything is OK. But Now how will I use this response as json

}
});
};


Thanks

dombroskib
6 Jul 2010, 6:36 AM
Need to decode the string into an object


var o = Ext.decode(response.responseText);