Print this page

User gets the error XMLHttpRequest cannot load, No 'Access-Control-Allow-Origin' is present

Knowledge Article Number 000232680

Users get error  XMLHttpRequest cannot load, No 'Access-Control-Allow-Origin' is present in visualforce page

You may have a problem with an embedded visualforce page for custom objects that include custom components. The page might be embedded on the standard page layout for a custom object. When that custom object record is viewed, the VF page is rendered. The page then starts polling to see when a process is complete. This polling request is failing because the request is originating from a different domain. 

For e.g. you can see that the Origin header is set to “”. The request is going to “” so the request fails.


The issue can be addressed using the built-in HTTP(S) Proxy. You can enable the proxy in the standard setup menu.

Setup -> Security Control -> Remote Sites / Remote Proxy Settings
There you can add your own salesforce instance. e.g. (don't forget to enable https).

In a second step you have to modify your ajax request to set url as ""
The best solution is to use the fully documented HTTP Proxy service from Salesforce.

promote demote