<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.getJSON("data.json",function(result){
$("div").append(result[0].name);
});
});
});
</script>
</head>
<body>
<button>获取 JSON 数据</button>
<div></div>
</body>
</html>
jQuery.getJSON()等同于: