XMLHttpRequest cannot load file. Cross origin requests are only supported for HTTP

后端 未结 7 958
太阳男子
太阳男子 2020-11-22 07:08

I am getting the following error:

XMLHttpRequest cannot load file:///C:/Users/richa.agiwal/Desktop/get/rm_Library/templates/template_viewSettings.html. Cross         


        
7条回答
  •  长发绾君心
    2020-11-22 07:33

    To add to Alan Wells's elaborate answer here is a quick fix

    Run a Local Server

    you can serve any folder in your computer with Serve

    First, navigate using the command line into the folder you'd like to serve.

    Then

    npx i -g serve
    serve
    

    or if you'd like to test Serve with downloading it

    npx serve
    

    and that's it! You can view your files at http://localhost:5000

提交回复
热议问题