1
我在http://feedthefire.in和Firebase dot com上設置並註冊了帳戶,以管理我願意在我的網站上展示的Feed。我將所有內容都設置好了,並將提要拉到Firebase中,就像它現在應該加入到Firebase一樣,現在是時候將其添加到網頁中了......沒有什麼,無法從Firebase中獲取提要。我在標題中加入firebase.js參考和身體,我把將Firebase VAR添加到網站
<script type="text/javascript">
var ref = new Firebase"'https://aodf.firebaseio.com");
ref.child("meta").once("value", function(snapshot) {
$("#e-title").html(snapshot.val().description);
});
ref.child("articles").limit(3).on("child_added", function(snapshot) {
var article = snapshot.val();
var link = $("<a>", {
"href": article.link,
"target": "_blank"
});
$("#e-list").append($("<li>").append(link.html(article.title)));
});
當你去http://sandbox.studiorooster.com/ao我應該看到提要列表,但是我沒有,所以我知道我我應該在代碼中放置其他的東西;我覺得:)
感謝羅布。我按照建議進行了修改,但仍然無法解決任何問題。還有其他想法?再比你一次。 –
看着[http://sandbox.studiorooster.com/ao/](http://sandbox.studiorooster.com/ao/),你仍然在這裏有一個語法錯誤:'var ref = new Firebase「https:/ /aodf.firebaseio.com「);'應該是'var ref = new Firebase(」https://aodf.firebaseio.com「);'。 –
我推薦閱讀[Google Chrome DevTools](https://developers.google.com/chrome-developer-tools/docs/console)以瞭解如何使用瀏覽器工具來追蹤這些問題。 –