You should move backbone.js after underscore.js as underscore is a dependency of Backbone.
Backbonejs and underscorejs files included but browser console showing eror
-
17-07-2023 - |
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
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow