-1
我在我的模型上創建了一個名爲'post'的函數,我想通過POST請求通過自定義url(下面的示例)向服務器發送請求。我如何設置url而不影響rootUrl發送請求? TIA!Backbone.JS:模型功能的自定義url
MyModel = Backbone.Model.extend({
urlRoot: '../mymodel'
initialize: function(){
},
post: function(){
// how put the url here?
// this is the custom url: '../post/mymodel/' + this.model.get('id')
// this is the expected log on server:
// POST: ../post/mymodel/323133
});
謝謝!但我怎麼能通過POST請求? – jrsalunga