mde / timezone-js

DEPRECATED: Timezone-enabled JavaScript Date object. Uses Olson zoneinfo files for timezone data.
824 stars 183 forks source link

loadZoneJSONData() does not work cross domain in IE9 #81

Closed doapp-ryanp closed 4 years ago

doapp-ryanp commented 11 years ago

_tz.loadZoneJSONData('/timezones.json', true); //works in IE9

_tz.loadZoneJSONData('http://mycdn.com/timezones.json', true); //does not work in IE9

I have CORS setup correctly (I'm using s3 to host the json file). Works in FF, Chrome etc.

Anyone know a workaround for this?

This lib is badass btw.

mde commented 11 years ago

The problem is that IE8 and 9 don't use XHR for cross-domain requests -- they use the 'special' XDomainRequest object, which has (of course) a slightly different API from XHR. If you use a transport which supports XDomainRequest, you should be good.

A side note -- even JQuery still doesn't support this natively -- you have to use a plugin: http://bugs.jquery.com/ticket/8283

doapp-ryanp commented 11 years ago

hmm I use JQuery $.ajax all the time to get json files via CORS from s3 and it works fine in IE8/9/10. When I get some time I'll come back to this and see if I can come up with a fix I can contribute.

longlho commented 11 years ago

You'll only have to change the transport layer to account for CORS. Just be careful not to break the interface