. Advertisement .
..3..
. Advertisement .
..4..
How to solve the problem – not allowed to load local resource:? I have the sample detail:
function run(){
var URL = "file:///C:\002.jpg";
window.open(URL, null);
}
run();
While I was running it, I found the warning message:
Cannot open local file - Chrome: Not allowed to load local resource
That is my question in my midterm exam, and it is urgent. I searched the solutions on some websites, but I didn’t get it. I may miss any line or other changes. I appreciate your assistance!
The cause: I think this error happens because you don’t use Chrome.
The solution: Now, you open Web Server for Chrome, select the folder you want to work with, and navigate to URL.
1) Open your terminal, and type
npm install -g http-server
2) Open the root folder where you want to store your files. Type:
http-server ./
3) Look at the output of your terminal. A
http://localhost:8080
will be displayed.All of it will be possible to get. Example:
background: url('https://localhost:8080/waw.png')
;