How to get the values from the Json using Jquery -
hi i'm new jquery , don't know how use json data. have json coming response. success function is
success: function(resp) { var x = json.stringify(resp); alert(x); }
alert having following json
{"xyz":{"abc":[{"action":"fail","result":"xxx"},{"action":"pass","resut":"yyy"}]}}
i want action value alone. how can value x variable , how can utilize value in html. in advance.
when use json.stringify()
turning string, want object access data. try this:
success: function(resp) { alert(resp.xyz.abc[0].action); var x = resp.xyz.abc[0].action // use value in html later on }
if returned string (i can't tell @ point), can turn object (as long valid json) using $.parsejson()
Comments
Post a Comment