1

Has anyone ever seen this? I don't how to expand on this. It's the only symptom. It will not sync in IE.

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
  • so no fiddler traffic generated at all? – timDunham Dec 15 '11 at 15:44
  • nothing. if i follow the execution into jquery - for IE transport is null: // If no transport, we auto-abort if (!transport) { done(-1, "No Transport"); –  Dec 15 '11 at 16:07
  • 1
    any chance you're making a cross-domain post? – timDunham Dec 15 '11 at 16:23
  • yes we are but it's working in all the other browsers? –  Dec 15 '11 at 16:28
  • 1
    cross domain GET more specifically but yeah, works in all other browsers? –  Dec 15 '11 at 16:29
  • IE is a little more picky about cross-domain. Check out the solutions here: http://stackoverflow.com/questions/5241088/jquery-call-to-webservice-returns-no-transport-error – timDunham Dec 15 '11 at 16:30
  • Not to sound arrogant - shouldn't backbone be taking care of jsonp for me? –  Dec 15 '11 at 16:33
  • That's probably food for a long discussion. In short I think backbone tries to stay very simple (e.g. not having a check for if you are or are not making a request on another domain and switching the data type of the ajax request). – timDunham Dec 15 '11 at 16:40

2 Answers2

2

Cross Domain requests in IE are supported via only the IE-specific object called XDomainRequest. XDomainRequest is too basic when compared with the XMLHTTPRequest object that's implemented in all other major browsers!

I am guessing you are using jQuery for Ajax-requests. jQuery does not use the XDomainRequest for making Cross-Domain calls on IE, so you are out of luck!

XDomainRequest offers only a subset of XMLHTTPRequest's features. For example, it is impossible to insert any custom headers to the HTTP-Get/Post requests, via XDomainRequest [typically you would use the jQuery's "onBeforeSend" callback for this purpose].

Please refer to this MSDN documentation: http://msdn.microsoft.com/en-us/library/cc288060(v=vs.85).aspx.

I encountered all these in my current project and finally ended up using a Proxy i.e. mod_proxy, on the Apache server that's hosting my app. Please have a look at my related answer on this topic How to make an ajax request to an API using CORS and backbonejs

Community
  • 1
  • 1
Karthik
  • 1,006
  • 3
  • 10
  • 19
2

This may help others searching for IE Backbone sync issues. I had an IE6-7 problem where sync didn't work because the global JSON object doesn't exist. The default Backbone Sync implementation uses JSON.stringify to generate the parameters. The JSON object is not present in IE6 and 7 so you'll need a conditional comment and include crockford's json2.js script which adds a window.JSON object :

https://github.com/douglascrockford/JSON-js/blob/master/json2.js

After adding that Backbone worked right from IE6.

Typo Johnson
  • 5,974
  • 6
  • 29
  • 40