Skip to content

Instantly share code, notes, and snippets.

@berzniz
Last active December 20, 2015 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berzniz/6186656 to your computer and use it in GitHub Desktop.
Save berzniz/6186656 to your computer and use it in GitHub Desktop.
Backbone.easyXDMxhr = new easyXDM.Rpc({
remote: 'http://foo.bar/cors/',
}, {
remote: {
request: {}
}
});
Backbone.ajax = function() {
var options = arguments[0];
options.method = options.type;
Backbone.easyXDMxhr.request(options, function(response) {
options.success && options.success(JSON.parse(response.data), response.status);
}, function(response) {
options.error && options.error(JSON.parse(response.data.data), response.data.status);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment