[英]Google Feed API JSON output not showing latest records
我正在嘗試使用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>
您對q
url查詢參數進行了錯誤編碼,並且callback
參數存在問題。 請嘗試以下網址:
https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&q=http://www.propertyguru.com.sg/news-rss/SG-PM
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.