admin管理员组

文章数量:1241150

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.

本文标签: javascriptquotBackboneModelextend() is not a functionquotwhat have I done wrongStack Overflow