rest - Backbone model URL propertry is set but still getting error that it mut be specified -


i'm new backbone, , i've been successful model , view implementation. looking building restful back-end experiment aspect of backbone. so, i've created simple client test requests , responses. however, keep receiving error:
a "url" property or function must specified

seems me client problem, perhaps on server side. can explain why might getting error, of if setup wrong, why?

var m_blog = backbone.model.extend({     defaults: {         url:'/lib',         title: null,         date: null,         content: null,         keywords: null,     } });  var = new m_blog({title:'t', date:'d', content:'c', keywords:'w'});  a.save({        success: function(model, response) {            alert('success' + response.getresponseheader());        },        fail: function(model, response) {            alert('fail' + response.getresponseheader());        } }); 

i've tried simple save call since, i'm not sure yet if above works:

a.save(); 

i believe attribute called "urlroot". have tried changing defaults this?

defaults: {     urlroot:'/lib',     title: null,     date: null,     content: null,     keywords: null, } 

url function name on model urlroot (ie. model.url()).

if doesn't work, try setting urlroot way although i'm pretty sure it's doing same thing above :-).

var m_blog = backbone.model.extend({     defaults: {         title: null,         date: null,         content: null,         keywords: null,     },      urlroot: '/lib' }); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -