dojo.fromJson

<!DOCTYPE HTML>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Demo</title>
		<script src="dojo16/dojo/dojo.js"
		data-dojo-config="async: true, parseOnLoad: true,isDebug:true"></script>
		</link>
		<script type = "text/javascript">
            var json = "{a:1,b:1}";
            var json2 =  "{a:'1',b:'1'}";
            var result1 = dojo.fromJson(json);
            var result2 = dojo.fromJson(json2);
            console.log(result1);
            console.log(result2);

		</script>
	</head>
	<body>
		<div id = "test">
			hello
		</div>
	</body>
</html>
 

你可能感兴趣的:(json)