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

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top