When running the following code in Chrome, d3.json
callback is not triggered until pubs.json
is loaded in another browser tab/window. It works when the d3.json
is pasted into the Chrome browser console, it works if running in Firefox...
I'm using Python's http.server
on localhost
.
Why does it act this way in Chrome?
dir structure:
proj/
index.html
pubs.json
code:
<html>
...
<body>
...
<script>
$(document).ready(function(){
d3.json("/pubs.json").then(function(data) {
console.log(data);
});
});
</script>
</body>
</html>