我想显示从在线网址到HTML表格的json数据?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>JSON Sample</title>
</head>
<body>
<div id="placeholder"></div>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script>
$.getJSON('test.json', function(data) {
var output="<ul>";
for (var i in data.items) {
output+="<li>" + data.items[i].Id + " " + data.items[i].name + "--" + data.items[i].old+"</li>";
}
output+="</ul>";
document.getElementById("placeholder").innerHTML=output;
});
</script>
</body>
</html>
如何使用在线网址更改test.json? 它没有显示任何结果,请你帮助我