dylanmac
dylanmac

Reputation: 353

D3: "Invalid argument" error using d3.js in IE9

I am trying to to get maps working in IE9 using d3.v3.js, world-110m.json and topojson.v1.js (I'm also using jQuery 10.1 so that is loaded too). It works fine in FF and Chrome but, as I am aware, IE 8 and below do not have native SVG support and therefore cannot be supported without workarounds.

Unfortunately, IE9 does not seem to work either. An error is thrown in the IE 9 console:

SCRIPT87: Invalid argument. d3.v3.js, line 726 character 4

    d3_selectionPrototype.insert = function(name, before) {
        name = d3_selection_creator(name);
        before = d3_selection_selector(before);
        return this.select(function() {
          return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments));
        });
    };

Line 726 is "return this.insertBefore" etc. Any ideas what's going on and how to resolve?

Upvotes: 1

Views: 1786

Answers (1)

Stephen Thomas
Stephen Thomas

Reputation: 14053

IE9 doesn't implement insertBefore quite the same way as other browsers. More detail in the answer to this question I suspect that in your case the second argument is null.

Upvotes: 2

Related Questions