일부 이미지의 URL을 다운로드하기 위해 JQuery의 $.getJSON
함수를 사용하고 있는데 div로 출력하려고합니다. 나는이처럼 보이도록 출력을 얻기 위해 노력하고 있어요 :JQuery 이미지 대신 '[object, Object]'추가
<a href="the image url (shot.short_url)"><img src="the direct image url (shot.image_teaser_url)" /></a>
을하지만,이 대신에 출력됩니다 : 나는 출력 밖으로 경우 잘못된 갈거야 어디
<div id="body-wrapper">
<a href="http://drbl.in/300896">[object Object]</a>
<a href="http://drbl.in/298080">[object Object]</a>
<a href="http://drbl.in/290395">[object Object]</a>
<a href="http://drbl.in/290324">[object Object]</a>
<a href="http://drbl.in/268595">[object Object]</a>
<a href="http://drbl.in/265197">[object Object]</a>
<a href="http://drbl.in/256368">[object Object]</a>
<a href="http://drbl.in/252519">[object Object]</a>
<a href="http://drbl.in/242235">[object Object]</a>
<a href="http://drbl.in/241676">[object Object]</a>
</div>
당신은 말해 줄 수주십시오 영상? - 그래서 생산하는 문자열에 추가 [개체 개체
function work() {
$('#body-wrapper').empty();
$.getJSON("http://dribbble.com/jakekrehel/shots.json?callback=?", function(data){
$.each(data.shots, function(i,shot){
var image = $('<img/>').attr('src', shot.image_teaser_url);
var title = '<a href=\"' + shot.short_url + '\">';
var string = title;
string = string + image;
string = string + '</a>';
$('#body-wrapper').append(string);
});
});
}
문자열이 아닌 개체입니다. URL 값으로 다시 참조하십시오. – Joe
고마워,'var image = '';'지금 사용하고 있습니다. –