저는 deezer API를 사용하여 아티스트를 검색하고 Jquery를 사용하여 이미지의 이름과 이미지를 표시하려고합니다. 내 코드는 다음과 같습니다.Deezer Api는 어떻게 사용합니까?
$.getJSON('http://api.deezer.com/search/artists?q='+q+'',
function(data) {
$("#artists").empty();
$.each(data, function(i,item){
var y=item.picture;
var z=x+y;
$("#artists").append("<div id='card_artist'><div id='cardimg' style='background-image: url("+ z +");'></div><div id='artistname' class='jtextfill'><span>" + item.name + "<span></div></div>");
});
});
하지만 작동하지 않습니다. 코드는 잘 보이지만, 내가 어떻게 해결에 대한 실마리 여부가이 오류 메시지를 던지고 계속 :
XMLHttpRequest cannot load http://api.deezer.com/search/artists?q=whatever. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
가 어떻게 작동하는 얻는가를?
아 !!! * facepalm * 잘못된 방향으로 가고있었습니다 ... JSONP에 대해 완전히 잊어 버렸습니다. 정리 해줘서 고마워요! – looserlf