I'm facing an issue with my HTML file that contains multiple d3-graphs embedded directly within script tags. When I try to move one of the graphs to an external JavaScript file, I receive the following error message: "NS_ERROR_DOM_BAD_URI: Access to restricted URI denied." Interestingly, when I remove the code that references a local JSON file using d3.json, the error goes away. However, it should be possible to load a JSON file in an external JavaScript file embedded in an HTML file, right?
d3.json("forcetree.json", function(json) {
root = json;
update();
});