Friday, 15 April 2011

javascript - Parsing Json using jquery - not getting value -



javascript - Parsing Json using jquery - not getting value -

i getting next values server

{"status":{"message":"success","code":200},"data":[{"sent":"test","category":"appo","experience_time":"2014-10-07","sent_id":4501922,"categoryid":4011,"score":"negative","feature":"emp","op":"challenges"}]}

i need value of sent,category,experience_time,sent_id,score,feature,op etc

i have tried next far.but not getting value.

var result = jquery.parsejson(data); $.each(result, function(index, value) { alert(value.score); });

try this,

class="snippet-code-js lang-js prettyprint-override">var jsonstring = '{"status":{"message":"success","code":200},"data":[{"sent":"test","category":"appo","experience_time":"2014-10-07","sent_id":4501922,"categoryid":4011,"score":"negative","feature":"emp","op":"challenges"}]}'; var result = jquery.parsejson(jsonstring); $.each(result.data, function(index, value) { alert(value.score); }); class="snippet-code-html lang-html prettyprint-override"><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

javascript jquery json

No comments:

Post a Comment