Copy Code code as follows:
{"Options": [{] "text\": \ "Wangjiawan \", "value\": \ "9\"},{\ "text\": \ "Li Jia Wan \", \ "Valu
E\ ": \ 10\"},{\ "text\": \ "Shaojia bay \", \ "value\": \ "13\"}] "}
<script type= "Text/javascript" >
var d1 =[{"text": "Wangjiawan", "Value": "9"},{"text": "Li Jia Wan", "value": "},{" "Text": "Shaojia Bay", "Value": "13"}];
$ (D1). each (function () {
If
alert (This.text);
});
</script>
JavaScript to complete the traversal.
Copy Code code as follows:
<script type= "Text/javascript" >
var json = {"Options": "[{]" text\ ": \" Wangjiawan \ "," value\ ": \" 9\ "},{\" text\ ": \" Li Jia Wan \ "," value\ ": \" 10\ "},{\" text\ ": \" Shaojia Bay ", \ "value\": \ "13\"} "}
JSON = eval (json.options)
for (var i=0; i<json.length; i++)
{
Alert (json[i].text+ "" + json[i].value)
}
</script>
If you start with a string type, the JSON is converted to a JSON object. with Eval ();
For example: var json = eval (Strjson);