Reputation: 379
For the life of me I cannot figure out why this isnt working...
It retrieves backbone and underscore no problem, and will not propagate any errors, but it also will not output hello world to the console.
<body>
<script src="D:/underscore.js"></script>
<script src="D:/"></script>
<script type="text/javascript">
Person = Backbone.Model.extend({
initialize: function() {
console.log('hello world');
}
});
</script>
</body>
</head>
Upvotes: 1
Views: 77
Reputation: 43790
You need to create a new Person. All that you have done at this point is specify the properties of the Person model. So add:
var myPerson = new Person();
At the end of your script tag. And that should work.
Upvotes: 3