I am following backbone.js for primers and I am stuck in the first hurdle. I get a TypeError: a.apply is not a function error message in firebug (Firefox 20.0.1). I have the following code:
<!DOCTYPE html> <html lang="en"> <head> <title>Backbone Test</title> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.1.1/css/bootstrap.min.css" /> <meta charset="utf-8" /> </head> <body> <div class="container"> <h1>User Manager</h1> <hr /> <div class="page"></div> </div> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js" type="text/javascript"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js" type="text/javascript"></script> <script> var Router = new Backbone.Router.extend({ routes: { '': 'home' } }); var router = new Router(); </script> </body> </html>
I use these old versions of jquery, underscores, and backbones because they are the versions used in the tutorial. I tried using the current versions of all, and I get a similar error: "TypeError: i.apply is not a function."
The error occurs when an instance of Router is created, i.e. line: var router = new Router(); above.
Is there an error with my setup? WAMP, or code, or libraries? I cannot understand this as the same with the letter, like a textbook .
source share