How to enable 'Access-Control-Allow-Origin' header for all files in a directory of XAMPP?

后端 未结 2 1121
旧巷少年郎
旧巷少年郎 2021-02-12 11:30

I am developing a HTML5 Javascript app to get an image from my local server which runs on the same machine as the app. When I run the app on my Chrome, I got:

2条回答
  •  再見小時候
    2021-02-12 12:05

    You need to create the .htaccess file first and put it on your root document of application and then set it at the beginning of the file

    Header set Access-Control-Allow-Origin *
    

    Cheers,

提交回复
热议问题