From ff56458d9dd854497f87bb11d963a67c5b615297 Mon Sep 17 00:00:00 2001 From: Mcallew Date: Tue, 30 Jun 2015 11:52:41 +0200 Subject: [PATCH] avoid to enter in conflict with jsonp mechanism --- Backbone.CrossDomain.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Backbone.CrossDomain.js b/Backbone.CrossDomain.js index 9f3e8a7..8250e21 100644 --- a/Backbone.CrossDomain.js +++ b/Backbone.CrossDomain.js @@ -65,6 +65,11 @@ // the original 'Backbone.sync' is still available in 'Backbone.vanillaSync' Backbone.sync = function(method, model, options) { + // avoid to enter in conflict with jsonp mechanism + if (options.dataType === 'jsonp') { + return Backbone.vanillaSync.apply(this, arguments); + } + // See if we need to use the XDomainRequest object for IE. If the request is on the // same domain, we can fall back on the normal Backbone.ajax handling. var useXDomainRequest = false;