Workaround for IE's lack of xhr.overrideMimeType.

This doesn't appear to be supported even in IE9, which means the server
must set the correct content type to get the correct mime type
behaviour.  I think this is only important to trigger XML parsing but
I'm not sure.
This commit is contained in:
Jason Davies 2011-03-15 13:06:36 +00:00
Родитель bb6f3c6ca0
Коммит f7cee9c225
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1,7 +1,7 @@
d3.xhr = function(url, mime, callback) {
var req = new XMLHttpRequest();
if (arguments.length < 3) callback = mime;
else if (mime) req.overrideMimeType(mime);
else if (mime && req.overrideMimeType) req.overrideMimeType(mime);
req.open("GET", url, true);
req.onreadystatechange = function() {
if (req.readyState == 4) callback(req.status < 300 ? req : null);