Skip to content

Instantly share code, notes, and snippets.

@eyeseast
Created December 1, 2010 16:32
Show Gist options
  • Save eyeseast/723741 to your computer and use it in GitHub Desktop.
Save eyeseast/723741 to your computer and use it in GitHub Desktop.
Overriding sync to make this a read-only jsonp app
// Overriding sync to make this a read-only jsonp app
Backbone.sync = function(method, model, success, error) {
$.ajax({
url: getUrl(model),
type: 'GET',
// jsonp is read-only
//contentType: 'application/json',
data: null,
// nothing to send
dataType: 'jsonp',
processData: false,
success: success,
error: error
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment