JS takes out the values in the JSON array
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>js out the values in the JSON array </title>
<body>
<script language= "JavaScript Tutorial" >
var json={"status": 1, "info": "u83b7u53d6u6210u529f", "data": [{"id": "4", "Name": "U77f3u5bb6u5e84", "Information": " U5e02 "," region_id ":" 3 "," type ":" 1 "}]}
var data=json.data;
for (i=0;i<data.length;i++)
{
document.write ("Name:" +data[i].name+ ", Info:" +data[i].information+ ");
}
</script>
This is primarily used for traversing the JSON array value and outputting
<script language= "JavaScript" >
function e ()
{
var json=[{"kl_id": "2", "Kl_title": "Test Date", "Kl_content": "Test Date", "Kl_type": "1", "id": "1"},{"kl_id": "2", "Kl_" Title ":" Test "," kl_content ":" Test "," Kl_type ":" 1 "," id ":" 2 "}]
var str = "";
For (Var one in JSON)
{
for (var key in Json[one])
{
STR + + Json[one][key] + ",";
}
}
Document.form.txtName.value = str;
}
</script>
<form >
<input name= "Txtname" >
</form>
</body>