最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin4浏览0评论

I am having a crack at Backbone 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?

I am having a crack at Backbone 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?

Share Improve this question asked Sep 22, 2011 at 1:07 bundybundy 1211 silver badge7 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 19

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

http://jsfiddle/ambiguous/AFmQ2/1/

From the fine manual:

Backbone's only hard dependency is Underscore.js.

发布评论

评论列表(0)

  1. 暂无评论