json的概述
json的基础语法
运行代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
// 定义json
var json = {
"name":"zhangsan",
"age":23,
"addr":["北京","上海","西安"]
};
// 获取值
alert(json.name); // 根据name这个键,获取对应的值
</script>
</body>
</html>