Home>

For example, the json string in the database looks like this

var str="[{" name ":"Zong 2melon "," num ":" 1 "," price ":" 122 "}, {" name ":"Zong呱呱 "," num ":" 1 " , "price":"100"}] ";
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);

Looping words,the same as above

  • Previous Method for parsing command line parameters using the flag package in Go
  • Next Example to explain the use of ContentProvider component in Android
  • Trends