Question

I downloaded backbone.js and underscore.js and included it in the tags and defined the model but the browser is showing uncaught error and anonymous function

<!DOCTYPE html>
  <html>
 <head lang="en">
 <meta charset="UTF-8">
 <title>Backbone Twitter</title>
</head>
  <body>

<h1>Backbone for Testing</h1>
<script src="backbone.js"></script>
<script src="   ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="underscore.js"></script>
<script>
var Tweet = Backbone.Model.extend({




});

console.log(new Tweet({author: 'ABCD', status: 'Hi Backbone Js' }));
</script>


 </body>
</html>

I have watched tutorials they do the same way, very new to Backbonejs

Was it helpful?

Solution

You should move backbone.js after underscore.js as underscore is a dependency of Backbone.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top