1
我試圖用骨幹網和火力地堡建立一個基本的應用程序:火力地堡和骨幹
http://jsfiddle.net/C9wew/6324/
var counter = 0;
var Box = Backbone.Firebase.Model.extend({
defaults: {
number: 0
},
//firebase: new Firebase('https://backbone-firebase.firebaseio.com/box')
});
var BoxList = Backbone.Firebase.Collection.extend({
model: Box,
firebase: new Firebase('https://backbone-firebase.firebaseio.com/')
});
var Boxes = new BoxList;
var AddBox = Backbone.View.extend({
el: $('#addBox'),
events: {
"click" : 'addBox'
},
addBox: function() {
console.log("adding box");
Boxes.add({
number: counter
});
counter = counter+1;
}
});
var addBox = new AddBox();
錯誤堆棧跟蹤:
Uncaught TypeError: undefined is not a function backfire.min.js:1
b.Firebase.Collection.b.Collection.extend.constructor backfire.min.js:1
d backbone-min.js:27
(anonymous function) (index):56
jQuery.event.dispatch jquery-git2.js:4397
elemData.handle jquery-git2.js:4076
Uncaught TypeError: Cannot assign to read only property 'id' of 1 backfire.min.js:1
a.extend._childAdded backfire.min.js:1
(anonymous function) firebase.js:93
ic firebase.js:43
Wd firebase.js:93
Ud.Jb firebase.js:93
Xd.Jb firebase.js:94
(anonymous function) firebase.js:109
(anonymous function) firebase.js:59
cc firebase.js:55
R firebase.js:59
(anonymous function) firebase.js:109
Sa firebase.js:23xe firebase.js:109
W firebase.js:109
h.hc firebase.js:117
h.gc firebase.js:85
dd.gc firebase.js:76
(anonymous function) firebase.js:74
Lc firebase.js:58
W.onmessage firebase.js:57
問題是,我得到一個Firebase出現很多奇怪的錯誤。我已經讀過Firefox中存在的奇怪錯誤,但現在我正在使用Chrome並得到不同的錯誤。
你得到了什麼錯誤?請在你的問題中包含完整的錯誤信息。爲此目的下面有一個「編輯」鏈接。 – 2014-11-05 18:56:21
版本信息對於這樣一個難懂的錯誤也是至關重要的。請參閱[創建mcve](http://stackoverflow.com/help/mcve)以獲得一些關於措辭問題的幫助。 – Kato 2014-11-07 17:31:46