Commit 65ec4c7e authored by Mike Bostock's avatar Mike Bostock
Browse files

Fix for cross-domain d3.dsv in IE9.

In some cases IE9 processes the opening of an XDomainRequest synchronously, so
by the time we were setting the response function to parse the DSV file, it was
too late. So instead we use the internal d3_xhr method to set the response
function before the request is sent. This is a continuation of fix #1260.
parent 525cbbfe
{
"name": "d3",
"version": "3.3.10",
"version": "3.3.11",
"main": "d3.js",
"scripts": [
"d3.js"
......
......@@ -10,7 +10,7 @@
"animation",
"canvas"
],
"version": "3.3.10",
"version": "3.3.11",
"main": "index-browserify.js",
"scripts": [
"d3.js",
......
d3 = function() {
var d3 = {
version: "3.3.10"
version: "3.3.11"
};
if (!Date.now) Date.now = function() {
return +new Date();
......@@ -1937,11 +1937,11 @@ d3 = function() {
var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0);
function dsv(url, row, callback) {
if (arguments.length < 3) callback = row, row = null;
var xhr = d3.xhr(url, mimeType, callback);
var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);
xhr.row = function(_) {
return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row;
};
return xhr.row(row);
return xhr;
}
function response(request) {
return dsv.parse(request.responseText);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "d3",
"version": "3.3.10",
"version": "3.3.11",
"description": "A small, free JavaScript library for manipulating documents based on data.",
"keywords": [
"dom",
......
......@@ -7,7 +7,7 @@ d3.dsv = function(delimiter, mimeType) {
function dsv(url, row, callback) {
if (arguments.length < 3) callback = row, row = null;
var xhr = d3.xhr(url, mimeType, callback);
var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);
xhr.row = function(_) {
return arguments.length
......@@ -15,7 +15,7 @@ d3.dsv = function(delimiter, mimeType) {
: row;
};
return xhr.row(row);
return xhr;
}
function response(request) {
......
d3 = (function(){
var d3 = {version: "3.3.10"}; // semver
var d3 = {version: "3.3.11"}; // semver
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment