This is basically a request for standards. I have inherited an Backbone / Marionette application that has a number of JSONP requests (Post and GET) being called from methods withing the Views. Is this the standard way of doing things? If not, how should we do it? My assumption would be in a collection??? There are also instances of nested jsonp calls...
var someView = Backbone.Marionette.Layout.extend({
doSomething : function() {
jsonp.request({url:url,type:"POST"},function(data){
// crazy stuff
jsonp.request({url:data.url,type:"POST"},function(data2){
// more crazy model updates
});
}, null, null, true);
}
}
I am thinking there should be a method on the model that is being updated that does a the jsonp stuff right?