I really researche for hours, but did not find any solution yet. I would like to get some data from a different server via jQuery
and ajax
. I get this error message in my chrome console:
XMLHttpRequest cannot load https://editeddomain.com//somedata.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63342' is therefore not allowed access. The response had HTTP status code 401.
This is my set up:
- PHPStorm 2016.1
- jQuery v3.2.1
- Google Chrome
- Fedora 25
This is what I already tried and I still get the same error:
<?php header('Access-Control-Allow-Origin: *'); ?>
- Started Chrome with
--disable-web-security
- Installed the Chrome Extension
Allow-Control-Allow-Origin: *
- Installed the Chrome Extension
JetBrains IDE Support
and added like JetBrains recommendedhttp://*/*
So none of those helped me and I am still seeing the error message.
PS: This tool is only for me, so that's why it is not and never will be installed on a different webserver than my PHPStorm environment