No 'Access-Control-Allow-Origin' header is present on the requested resource
Hi all,
Currently I am developing an Open Social Gadget to show data from reports of JRS, using javascript, css. when I perform a GET call to load the content from. json file, I get the below message:
"Failed to load https://<<my domain>>:8443/OSGReport/reports/report.json: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://<<ALM domain>>' is therefore not allowed access"
<<my domain>> is my local host server, on my PC, and <<ALM domain>> is the server that host ALM application
Can you please help me on resolving this issue?
Thank you,
Best Regards,
Anh Do
|
Accepted answer
This old post may be helpful to you.
Anh Do selected this answer as the correct answer
|
One other answer
alexa minar (11)
| answered Aug 10 '21, 3:25 a.m.
edited Aug 10 '21, 3:43 a.m. by Ralph Schoon (63.5k●3●36●46) Access-Control-Allow-Origin is a CORS (Cross-Origin Resource Sharing) header. The error you get is due to the CORS standard, which sets some restrictions on how JavaScript can perform ajax requests.
When Site A tries to fetch content from Site B, Site B can send an Access-Control-Allow-Origin response header to tell the browser that the content of this page is accessible to certain origins. By default, Site B's pages are not accessible to any other origin; using the Access-Control-Allow-Origin header opens a door for cross-origin access by specific requesting origins.
For each resource/page that Site B wants to make accessible to Site A, Site B should serve its pages with the response header:
Access-Control-Allow-Origin: http://siteA.com
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.