Tuesday 5 November 2013

Ajax call & json object creation from the response using CQ5

javascript

var response = CQ.utils.HTTP.get("resourcepath.selector.json");
if (CQ.HTTP.isOk(response)){ 
var myObject =CQ.HTTP.eval(response);
alert(myObject.name);
}

selector.json.jsp
{"name":"vimal"}

No comments:

Post a Comment