" NS_ERROR_DOM_BAD_URI:访问受限制的URI否认" [英] "NS_ERROR_DOM_BAD_URI: Access to restricted URI denied"

查看:163
本文介绍了" NS_ERROR_DOM_BAD_URI:访问受限制的URI否认"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个HTML文件的几个D3-图直接写在脚本标记进去。当我外包图形的一进一出外部js文件我得到这个消息NS_ERROR_DOM_BAD_URI:访问受限制的URI被拒绝。如果我删除了code与d3.json它读取本地JSON文件中的错误消失。但它必须是可能加载在其中嵌入到HTML外部JS一个JSON文件,对吧?

  d3.json(forcetree.json功能(JSON){
根= json的;
更新();
});
 

解决方案

我有同样的错误,解决的办法是让你的index.html,的script.js和data.json在同一目录下。

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();
});

解决方案

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

这篇关于" NS_ERROR_DOM_BAD_URI:访问受限制的URI否认"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆