我已经通过 YQL 将我的 scribd xml 提要(隐藏了它的密钥)转换为 JSON。
我想使用 jQuery 用结果填充无序列表。它适用于除 IE 之外的所有应用程序。
这对我来说似乎很简单,但我不明白为什么它在 Internet Explorer 中什么也没有。一定有一些我不知道的 IE 秘密,比如 JSON 在 IE 中的处理方式不同,或者您需要使用 JSONP,或者 IE 不能很好地使用 .each()... 我错过了什么这里?这是一个 jFiddle 链接来演示:http: //jsfiddle.net/niceindividual/nRkvS/2/
var yqlURL = "http://query.yahooapis.com/v1/public/yql/dulyb/scribdCHF?format=json";
window.console.log("The yqlURL variable is set to " + yqlURL);
$.getJSON(yqlURL, function(data) {
$.each(data.query.results.result, function() {
$('#results').append('<li><div><a href=\"http://www.scribd.com/doc/' + this.doc_id + '\">' + '<img src=\"' + this.thumbnail_url + '\" />' + '<span>' + this.title + '</span></div></a><p>' + this.description + '</p></li>');
});
});