[英]How can I fix "Not allowed to load local resource" error in microsoft edge or google chrome?
I am trying to link an external javascript file to my HTML file.我正在尝试将外部 javascript 文件链接到我的 HTML 文件。 But as soon as I run it my console shows this error "Not allowed to load local resource".但是一旦我运行它,我的控制台就会显示此错误“不允许加载本地资源”。 I read about its cause but can anyone help me with how to fix this?我阅读了它的原因,但任何人都可以帮助我解决这个问题吗?
my statement:我的声明:
" " " "
I have tried using a static web server extension in Chrome but it's not working.我尝试在 Chrome 中使用 static web 服务器扩展,但它不起作用。
When it comes to debugging code, opening it from disk by "double clicking" the HTML file is rarely a good idea.在调试代码时,通过“双击”HTML 文件从磁盘打开它并不是一个好主意。 Try using a local server instead.尝试改用本地服务器。 There are a lot of great ones available.有很多很棒的。 I don't know what IDE you are using, but VSCode has Live Server for example which works great, or you can use XAMPP as a standalone solution.我不知道您使用的是什么 IDE,但 VSCode 有 Live Server,例如效果很好,或者您可以使用 XAMPP 作为独立解决方案。
Don't enter full path of image.. Example: DO NOT ENTER LIKE THIS : C:\Users\A1\Desktop\vs\images\cloud.png Enter LIKE THIS : iamges\cloud.png just ensure that your folder named images is inside your project folder不要输入图像的完整路径。示例:不要像这样输入:C:\Users\A1\Desktop\vs\images\cloud.png 像这样输入:iamges\cloud.png 只需确保您的文件夹名为 images在您的项目文件夹中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.