I built a Backbone 1.0.0 app that is served from a domain: beta.mydomain.com
. This app fetches data from a JSON-only API available via api.mydomain.com
.
Since this causes the browsers cross domain policy to come into play, I completely opened up my API server for CORS requests. The response headers for every request include:
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, PUT, GET, OPTIONS, DELETE
Which seems to be enough for all browsers I tested so far. But it fails in IE8 with a 'Transport Error'.
Next step: JSONP. When I extend sync and set options.dataType = "jsonp"
I get an error in all browsers that states:
Uncaught SyntaxError: Unexpected token <
where I do not find out, where it comes from. Is there any chance to make CORS requests work in IE8, or is there any way to 'simply' enable JSONP so that my Backbone app works in IE8 as well?
Desperately... Felix