這有什麼錯誤的問題出現在Firefox瀏覽器類型錯誤:條目未定義
TypeError: entry is undefined
此錯誤
<script type='text/javascript'>
//<![CDATA[
function showlatestpostswiththumbs(json) {
document.write('<div class="terbaru">');
for (var i = 0; i < posts_no; i++) {
var entry = json.feed.entry[i];
var posttitle = entry.title.$t;
var postsurl;
if (i == json.feed.entry.length) break;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'replies' && entry.link[k].type == 'text/html') {
var commentstext = entry.link[k].title;
var commentsurl = entry.link[k].href;
}
if (entry.link[k].rel == 'alternate') {
postsurl = entry.link[k].href;
break;
}
}
var recenthumb;
try {
recenthumb = entry.media$postImageUrl.url;
} catch (error) {
s = entry.content.$t;
a = s.indexOf("<img");
b = s.indexOf("src=\"", a);
c = s.indexOf("\"", b + 5);
d = s.substr(b + 5, c - b - 5);
if ((a != -1) && (b != -1) && (c != -1) && (d != "")) {
recenthumb = d;
} else recenthumb = 'https://2.bp.blogspot.com/-C3Mo0iKKiSw/VGdK808U7rI/AAAAAAAAAmI/W7Ae_dsEVAE/s1600/no-thumb.png';
}
document.write('<div class="mas-elemen">');
document.write('<a href="' + postsurl + '"><img src="' + recenthumb + '"/></a>');
document.write('<h6><a href="' + postsurl + '" target ="_top">' + posttitle + '</a></h6>');
document.write('</div>');
}
document.write('</div>');
}
//]]>
</script>
<script style='text/javascript'>
var posts_no = 10;
var showpoststhumbs = true;
var readmorelink = true;
</script>
<script src="/feeds/posts/default/?orderby=published&alt=json-in-script&callback=showlatestpostswiththumbs"></script>
我得到這個錯誤while run snippet「」message「:」未捕獲的SyntaxError:意外的令牌<「」 –