I'm trying to get started with d3.js and something isn't right. I have this tag in my <head>
section
<script src="https://d3js.org/d3.v5.min.js"></script>
and this code in my javascript file
d3.json('http://localhost:53526/api/foo', function (data) {
console.log(data);
});
The problem is the call back never happens. No data is ever logged. Here's my javascript console:
But I can see the data from my json api in the network tab! It has sent a request and the request was successful but yet it doesn't call the callback function.
I've also read many examples of people using d3.request(url).get
but whenever I try this I just get the error message
Uncaught TypeError: d3.request is not a function
I'm getting the exact same behavior from both Chrome and Firefox. Have I missed something very basic here? Why doesn't d3 load any data?