다음과 같은 .js 코드가 있지만 사이트를 테스트 할 때 각 내용은 보이지만 내용은 표시되지 않습니다.블로그 게시물이 FOR 루프를 사용하는 동안 표시되지 않습니다.
$(document).ready(function(){
url = 'http://hopexxx.com/category/daily-devotion/feed/';
$.ajax({
type: "GET",
url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&callback=?&q=' + encodeURIComponent(url),
dataType: 'json',
error: function(){
alert('Unable to load feed, Incorrect path or invalid feed');
},
success: function(data){
var postlist = data.responseData.feed.entries;
var html = '<ul data-role="listview" data-filter="true">';
for (var i = 0; i < 5; i++) {
html += '<li>';
html += '<a href="#">';
html += '<div class="entry">entry.title</div>';
html += '<div class="entry">author</div>';
html += '<div class="entry">publishedDate</div>';
html += '<div class="entry">contentSnippet</div>';
html += '</a>';
html += '</li>';
}
html += '</ul>';
$("#postlist").append(html);
$("#postlist ul[data-role=listview]").listview();
}});
});
감사 rusmus는 효과가있었습니다. 기본 웹 사이트의 다른 페이지 콘텐츠를 표시하지 않고 클릭하면 각 게시물 콘텐츠를로드 할 수 있도록 다른 js를 만들어야합니까? –
당신이 무엇을 요구하고 있는지 잘 모르겠습니다. 당신은 아마 새로운 질문을 만들고 거기에 관련 html과 js를 추가해야합니다. – rusmus