Fix d3.xhr for local URIs. #632

Merged
merged 2 commits into from Jun 19, 2012
View
2 d3.v2.js
@@ -494,7 +494,7 @@ d3.xhr = function(url, mime, callback) {
req.onreadystatechange = function() {
if (req.readyState === 4) {
var s = req.status;
- callback(s >= 200 && s < 300 || s === 304 ? req : null);
+ callback(!s && req.response || s >= 200 && s < 300 || s === 304 ? req : null);
}
};
req.send(null);
View
6 d3.v2.min.js
3 additions, 3 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
2 src/core/xhr.js
@@ -7,7 +7,7 @@ d3.xhr = function(url, mime, callback) {
req.onreadystatechange = function() {
if (req.readyState === 4) {
var s = req.status;
- callback(s >= 200 && s < 300 || s === 304 ? req : null);
+ callback(!s && req.response || s >= 200 && s < 300 || s === 304 ? req : null);
}
};
req.send(null);