<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div></div>
<script type="text/javascript">
var str = '{ "name": "baba", "age": 12, "info": { "locate": "浙江" } }';
var user = JSON.parse(str);
console.log(user); // 输出一个 JavaScript 对象
</script>
</body>
</html>