【发布时间】:2015-04-01 10:53:51
【问题描述】:
我正在尝试使用 Google Feed API 加载 Feed,但我无法获取最新记录。我在下面尝试过:
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
$(function () {
url = 'http://www.propertyguru.com.sg/news-rss/SG-PM';
var randomNum = Math.floor((Math.random() * 10000) + 1);
$.ajax({
type: "GET",
url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=20&callback=?&q=' + encodeURIComponent(url) + '&nocache=' + (new Date).getTime() + randomNum,
dataType: 'json',
historical: false,
error: function () {
alert("Unable to load feed, Incorrect path or invalid feed");
},
success: function (data) {
alert(JSON.stringify(data, null, "\t"));
}
});
});
</script>
【问题讨论】:
-
您是否尝试将您的 AJAX URL 粘贴到网络浏览器中?
-
为 firefox 使用一些 REST 客户端插件并测试 REST url....
-
您的 AJAX 调用成功但返回 null。
-
这个 RSS 实际上有问题
-
来自this 提要也没有获得最新记录。
标签: json rss feed google-feed-api