javascript - Error: Backbone is not defined -
i trying run simple basic sample of backbone model found on tutorial learning library.
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.string/2.3.3/underscore.string.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js"></script> <script> user = backbone.model.extend({ initialize: function() { alert("backbone model initialized"); } }); var user = new user; </script>
but on console there 2 errors :
uncaught typeerror: object # has no method 'each' on backbone-min file
uncaught referenceerror: backbone not defined
and not working. yo please me understand doing wrong?
you're not loading full underscore library. replace second script tag following:
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
Comments
Post a Comment