Hi, I am a little bit confused. I am trying to use something like this:
// Since the urlRoot attribute is defined, all HTTP commands are to /library var Book = Backbone.Model.extend({urlRoot:'/library'}) var book = new Book(); // Performs a POST on /library with the arguments as a payload and the server returns the id as 1 book.save({title:'Bossypants',author:'Tina Fey',checkout:false}) // Performs a GET on /library/1 book.fetch({id:1}); // Performs a PUT on /library/1 with the entire modified object as a payload. book.save({checkout:true}); // Performs a DELETE on /library/1 book.destroy();,but I am getting error on calling save function.
... line = 1359; [ERROR] : message = "'undefined' is not an object (evaluating '$.ajax')"; [ERROR] : name = TypeError; [ERROR] : sourceId = 294813632; ...So is it because $.ajax requires jquery or where is the problem? Thank you