"NS_ERROR_DOM_BAD_URI: Access to restricted URI denied"

86,653

Solution 1

I was having the same error and the solution is to have your index.html, script.js and data.json in the same directory.

Solution 2

Specify your .json file relative to your .html file root

Ex:

d3.json("js/forcetree.json", function(json) {
  root = json;
  update();
});
Share:
86,653
Schnodderbalken
Author by

Schnodderbalken

I am the liquid that comes out of your nose. My shape is a timber. In Germany we call that thing SCHNODDERBALKEN!

Updated on July 26, 2022

Comments

  • Schnodderbalken
    Schnodderbalken almost 2 years

    I have an html-file with several d3-graphs directly written in script tags into it. When I outsource one of the graphs into an external js file I get this message "NS_ERROR_DOM_BAD_URI: Access to restricted URI denied". If I delete the code with d3.json where it reads a local json file the error disappears. But it has to be possible to load a json file in an external js which is embedded into an html, right?

    d3.json("forcetree.json", function(json) {
    root = json;
    update();
    });