0

Google のロード フィードが機能しません。例は www.eslangel.com にあるはずです

このコードをヘッダーに入れました

<script type="text/javascript" 
src="https://www.google.com/jsapi?key=ABQIAAAAO2BkRpn5CP_ch4HtkkOcrhQRKBUhIk5KoCHRT6uc9AuUs_-7BhRyoJdFuwAeeqxoUV6mD6bRDZLjSw">
</script>

次に、テストのために、Digg フィードを使用してサンプル コードをコピーし、ブログの本文に貼り付けましたが、何の結果もありません。

誰かが私が間違っているかもしれないことを知っていますか?

/*
*  How to load a feed via the Feeds API.
*/

google.load("feeds", "1");

// Our callback function, for when a feed is loaded.
function feedLoaded(result) {
  if (!result.error) {
    // Grab the container we will put the results into
    var container = document.getElementById("content");
    container.innerHTML = '';

    // Loop through the feeds, putting the titles onto the page.
    // Check out the result object for a list of properties returned in each entry.
    // http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON
    for (var i = 0; i < result.feed.entries.length; i++) {
      var entry = result.feed.entries[i];
      var div = document.createElement("div");
      div.appendChild(document.createTextNode(entry.title));
      container.appendChild(div);
    }
  }
}

function OnLoad() {
  // Create a feed instance that will grab Digg's feed.
  var feed = new google.feeds.Feed("http://www.digg.com/rss/index.xml");

  // Calling load sends the request off.  It requires a callback function.
  feed.load(feedLoaded);
}

google.setOnLoadCallback(OnLoad);​
4

1 に答える 1

1

さて、フィード用のコンテナも作成しましたか? :-)

置いてみる

<div id="content"></div>

フィード読み込みスクリプトの前。

于 2011-05-15T08:26:51.823 に答える