json 파일 (Steam API)을 가져 와서 테이블에 정렬 된 파일을 표시하려고합니다. 단추 및 목록으로 시도했지만 작동하지 않습니다. 그리고 나는 이것을 테이블로하는 방법을 모른다. (예 : http://carl-keinath.de/json.html) 모든 요소가 DOM에 액세스 할 수 있습니다 있도록 jQuery 코드가 body
에서와 같이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>
남자 감사합니다! : D –