---------------------------页面效果----------------------------------
---------------------------代码实现----------------------------------
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript(runoob.com)</title>
</head>
<body>
<h2>为 JSON 字符串创建对象</h2>
<p id="demo"></p>
<script>
var text = '{"employees":[' +
'{"firstName":"John","lastName":"Doe" },' +
'{"firstName":"Anna","lastName":"Smith" },' +
'{"firstName":"Peter","lastName":"Jones" }]}';
obj = JSON.parse(text);
document.getElementById("demo").innerHTML = JSON.stringify(obj).toString()+" "++"<br/><br/><br/>"+
obj.employees[1].firstName + " " + obj.employees[1].lastName;
</script>
</body>
</html>
-------------------代码解析------------------------------------