我想获取一个json文件(Steam API)并且想要在一个表中显示排序的文件。我已经尝试了一个按钮和一个列表,但它不起作用。我不知道如何用桌子做这个。 (例如:http://carl-keinath.de/json.html)获取JSON文件
<html>
<head>
<title>JSON</title>
</head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript">
$("button").click(function() {
$.getJSON("json_data.json", function(obj) {
$.each(obj, function(key, value) {
$("ul").append("<li>"+value.name+"</li>");
});
});
});;
</script>
<body>
<ul></ul>
<button>Refresh</button>
</body>
</html>
谢谢你man!:D – 2015-02-06 10:06:58