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.
https://jazz.net/forum/questions/208098/cross-domain-request-in-firefox-to-get-dwa-data-into-an-opensocial-gadget-in-rqm
There is also a detailed explanation of CORS for Firefox.
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
One other answer
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