admin管理员组

文章数量:1357112

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(".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=".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!

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./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./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!

Share Improve this question asked Aug 13, 2014 at 16:48 aschaeferaschaefer 351 gold badge1 silver badge7 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

insert the following into your html

<script src="http://d3js/d3.v3.min.js" charset="utf-8"></script>

I had a similar issue. It got solved after I replaced the link I was using with the one said above by @Ihoworko which is this

本文标签: javascriptUncaught ReferenceError d3 is not definedStack Overflow