Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught ReferenceError: d3 is not defined

I am new to web development and I am trying to upload a D3-based JS visualization to a Weebly domain. I have uploaded all required files to my Weebly site and referenced them properly in the JavaScript, but keep getting an Uncaught ReferenceError: d3 is not defined error on this line:

d3.csv("http://subdomain.weebly.com/files/theme/force.csv", function(error, links) {

Where I try to call d3 to load in a CSV file for my visualization. I can't seem to find out what the problem is.

Also, I loaded d3 (hosted locally) into the JS with this line:

<script src="http://subdomain.weebly.com/files/theme/d3.js" charset="utf-8"></script>

and also tried to link to d3 remotely, but still get the same error.

This has me very confused because everything works fine on my localhost.

Thanks!

like image 339
aschaefer Avatar asked May 23 '26 05:05

aschaefer


1 Answers

insert the following into your html

<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
like image 142
lhoworko Avatar answered May 24 '26 19:05

lhoworko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!