javascriptd3.jshttp-status-code-301http-status-code-304

How to link to d3.js-v3 source file without getting code 301/304 or TypeError


d3 is currently on v5, but I need to use v3. I am trying two ways to access v3:

  1. Including <script src="https://d3js.org/d3.v3.min.js"></script> in my HTML tag.
  2. Including <script src="d3.min.js"></script>, where the d3.min.js is a source file in d3.zip, downloaded from https://github.com/d3/d3/releases?after=v4.2.5.

With the first way, nothing from my code shows up. I get Code 301 and/or Code 304. Apparently d3js.org is not hosting source files for older versions?

With the second way, still nothing from my code shows up, even though I have the actual source file in my own folder. If I look at the console in the browser, I see that I am getting TypeErrors such as TypeError: e is undefined [Learn More] d3.min.js:1:15253.

Note: I'm using python's SimpleHTTPServer.

How can I get d3 v3 to work?


Solution

  • Consider using CDN. E. g. https://cdnjs.com/libraries/d3
    You can pick any version there.