The example of this article tells the JS Simple loop traversal JSON array method. Share to everyone for your reference, specific as follows:
For example, the JSON string inside the database is like this
var str = ' [{' name ']: "2 melon", "num": "1", "Price": "122"},{"name": "Zong Quack", "num": "1", "Price": "a";
var xqo = eval (' (' + str + ') ');
for (var i in Xqo) {
alert (xqo[i].name);
}
The above is JS, the following is jquery to parse the JSON string,
var cc = Jquery.parsejson (data);
alert (cc[0].title);
Loop, like the top.
More about JavaScript related content to view the site topics: "JavaScript in the JSON Operation tips Summary", "JavaScript switching effects and techniques summary", "JavaScript Search Algorithm Skills summary", " JavaScript animation effects and tips Summary, "JavaScript Error and debugging skills Summary", "JavaScript data structure and algorithm skills summary", "JavaScript traversal algorithm and Skills summary" and "JavaScript Mathematical operation Usage Summary"
I hope this article will help you with JavaScript programming.