Blocked by CORS policy: No 'Access-Control-Allow-Origin'

Hi. I am getting this error in my code on a site I’m working on. Can anyone tell me if the problem is on the Webflow side or on the server where the custom code is hosted?

Access to XMLHttpRequest at ‘Link’ from origin ‘Link’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

This is the site

Thanks for this. Where or how do I add that to the tweets.php file?

1 Like

Can you elaborate? This is not very clear

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