Looping through Dynamic JSON String

I have a POST request which receives a JSON String as a result. The fields, the values, or how deep the array is? These all are unknown. So, I need to loop through each of the json value, its index and its value and perform actions based on it. $.post( "test.php", { action: 'someaction', param: '2' }, function(data) { //now data is a json string $.each(data, function() { key = data.key; //i need to retrieve the key value = data.value; //i need to retrieve the value also //now below here, I want to perform action, based on the values i got as key and values } }, "json" ); How can i get the values of JSON seperated as `key` and `value`?

以上就是Looping through Dynamic JSON String的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准