<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Json</title>
<script type="text/javascript" src="../js/jquery-1.8.3.js" ></script>
<script type="text/javascript">
//获取年龄
var student={"name":"李四","age":"18"};
alert(student.age);//输出结果18
//获取小三的年龄
var JSON = {
"students":[
{"name":"李四","age":"18"},
{"name":"小三","age":"28"}
]
}
alert(JSON.students[1].age);输出结果28
</script>
</head>
<body>
</body>
</html>