the same d3.js file works in Firefox, but not in Google Chrome or microsoft Edge

77 views
Skip to first unread message

Joe

unread,
Jun 14, 2017, 7:12:55 AM6/14/17
to d3-js
I'm trying to run the Mike Bostock's box plot example file: https://bl.ocks.org/mbostock/4061502

I put the the following files in the same folder:
1. index.html
2. box.js
3. morley.csv
4. d3.js
5. d3.min.js


However, I encounter the following problems:
1. when I click the index.html file, I got an empty page in Firefox.
2. So, I changed line 32 in index.html from <script src="https://d3js.org/d3.v4.js"></script> to <script src="d3.js"></script>, and now, the box plot is shown in Firefox.
3. However, I still got a blank page when one the revised index.html in Chrome or Edge.

May I ask
1. why the original code specifying the web address of the d3.v3.min.js file was not working?
2. why the same index.html file produce different results in different browsers?

Thanks for your help.

Curran

unread,
Jun 14, 2017, 9:10:30 AM6/14/17
to d3-js
Are you running a local HTTP server?

Can you post the URL when you open the page as it appears in your browser? If it starts with file:// , the behavior will not be reliable across browsers.

Ji Zhang

unread,
Jun 14, 2017, 10:45:11 AM6/14/17
to d3-js
Thanks, Curran.

The URL is shown as file:///C:/Users/<USER_NAME>/Downloads/test/index.html in the web browser.

Can you kindly advise how we shall test the d3.js file on a local computer across different web browsers?

Thanks. 


--
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/Ihn6bxp5v7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Curran

unread,
Jun 15, 2017, 9:55:54 AM6/15/17
to d3-js
Hi Joe,

Aha, that's the cause of the problem. To test locally, you'll need to run an HTTP server on your computer. There are many options for doing this, but I'd recommend this one https://www.npmjs.com/package/http-server

Best regards,
Curran
Reply all
Reply to author
Forward
0 new messages