Monday 27 June 2016

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource

Write following code into cross-origin's .htaccess file

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

Example:


  • You open "http://example.com" (here you see the cross-origin error of http://abc.com)
  • Open .htaccess of abc.com and paste above code.

Ex 2 .

in php file : header('Access-Control-Allow-Origin: *');


No comments:

Post a Comment