Захотелось поизучать данный фреймворк. Пишу такой код в файле Model.js
И получаю вот такую ошибку (внизу)
Что это такое?
Person = Backbone.Model.extend({
initialize: function(){
alert("Welcome to this world");
}
});
var person = new Person();
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src = "backbone.js"></script>
<script type="text/javascript" src = "Model.js"></script>
<script type="text/javascript" src = "underscore.js"></script>
</head>
<body>
</body>
</html>
Код:
|
Uncaught TypeError: Cannot call method 'extend' of undefined backbone.js:213
Uncaught TypeError: Object function (attributes, options) {
var defaults;
attributes || (attributes = {});
if (options && options.parse) attributes = this.parse(attributes);
if (defaults = getValue(this, 'defaults')) {
attributes = _.extend({}, defaults, attributes);
}
if (options && options.collection) this.collection = options.collection;
this.attributes = {};
this._escapedAttributes = {};
this.cid = _.uniqueId('c');
this.changed = {};
this._silent = {};
this._pending = {};
this.set(attributes, {silent: true});
// Reset change tracking.
this.changed = {};
this._silent = {};
this._pending = {};
this._previousAttributes = _.clone(this.attributes);
this.initialize.apply(this, arguments);
} has no method 'extend' |