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:
Родитель
bb6f3c6ca0
Коммит
f7cee9c225
|
@ -1,7 +1,7 @@
|
||||||
d3.xhr = function(url, mime, callback) {
|
d3.xhr = function(url, mime, callback) {
|
||||||
var req = new XMLHttpRequest();
|
var req = new XMLHttpRequest();
|
||||||
if (arguments.length < 3) callback = mime;
|
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.open("GET", url, true);
|
||||||
req.onreadystatechange = function() {
|
req.onreadystatechange = function() {
|
||||||
if (req.readyState == 4) callback(req.status < 300 ? req : null);
|
if (req.readyState == 4) callback(req.status < 300 ? req : null);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче