开发者

"Backbone.Model.extend() is not a function", what have I done wrong?

开发者 https://www.devze.com 2023-04-06 19:04 出处:网络
I am having a crack at Backbon开发者_JS百科e and decided to open a jsFiddle to play around. Unfortunately, I keep getting this error being thrown:

I am having a crack at Backbon开发者_JS百科e and decided to open a jsFiddle to play around.

Unfortunately, I keep getting this error being thrown:

Backbone.Model.extend is not a function

My code:

var Model = Backbone.Model.extend();

I got this piece of code from a Backbone tutorial.

The fiddle.

What have I done wrong?


You need to include underscore.js before backbone.js as in this updated version of your fiddle:

http://jsfiddle.net/ambiguous/AFmQ2/1/

From the fine manual:

Backbone's only hard dependency is Underscore.js.

0

精彩评论

暂无评论...
验证码 换一张
取 消