Cannot open local file - Chrome: Not allowed to load local resource

后端 未结 14 1612
不知归路
不知归路 2020-11-22 12:01

Test browser: Version of Chrome: 52.0.2743.116

It is a simple javascript that is to open an image file from local like \'C:\\002.jpg\'

function run(         


        
14条回答
  •  自闭症患者
    2020-11-22 12:45

    1) Open your terminal and type

    npm install -g http-server

    2) Go to the root folder that you want to serve you files and type:

    http-server ./

    3) Read the output of the terminal, something kinda http://localhost:8080 will appear.

    Everything on there will be allowed to be got. Example:

    background: url('http://localhost:8080/waw.png');

提交回复
热议问题