Loop and get key/value pair for JSON array using jQuery

后端 未结 6 555
醉话见心
醉话见心 2020-11-29 23:31

I\'m looking to loop through a JSON array and display the key and value.

It should be a simplified version of the following post, but I don\'t seem to have the syn

6条回答
  •  不知归路
    2020-11-30 00:23

    The best and perfect solution for this issue:

    I tried the jQuery with the Ajax success responses, but it doesn't work so I invented my own and finally it works!

    Click here to see the full solution

    var rs = '{"test" : "Got it perfect!","message" : "Got it!"}';
    eval("var toObject = "+ rs + ";");
    alert(toObject.message);
    

提交回复
热议问题