내 콘솔에 아무런 오류가 없지만 PHP에서 json 인 thumbnail_url을 얻고 싶습니다. 콘솔에서 배열 문자열이라는 것을 보여 주며 어떻게 접근 할 수 있습니까?ajax를 사용하여 API에서 이미지 가져 오기
편집 : 원하는 출력을 실행할 수는 있지만 마지막 개체는 브라우저에서 출력되는 유일한 개체입니다. 몇 일이 잘못 여기거야
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Ajax Preview</title>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script>
$(function() {
var $data = $('#content');
$.ajax({
method:'GET',
dataType:'json',
url:'https://syncslider-ehnoxx07.c9users.io/temp.json',
success: function (data) {
$.each(data, function(i,data){
$data.html('<img src=' + data.thumbnail_url + '>');
});
}
});
});
</script>
</head>
<body>
<div id="content"></div>
</body>
</html>
어레이 출력도 여기에 표시 할 수 있습니까? – vher2
당신은 API와 API 자격 증명을 게시했습니다. 공개 게시물에서는 추천하지 않습니다. –
해당 Api 자격 증명은 모조품이지만 편집 해 주셔서 감사합니다. 여기에 PHP 스크린 샷이 있습니다 : https://postimg.org/image/4svg44ubn/ 및 네트워크에서 html 출력. https://postimg.org/image/b5vobivxr/ – camdev