No ‘Access-Control-Allow-Origin’ header is present on the requested resource

This topic will show you how to fix No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

No ‘Access-Control-Allow-Origin’ header is present on the requested resource

This happens if you are attempting cross domain request.That is you are sending request from one domain to another domain. Normal browsers doesn’t support cross domain request for security reasons. You can fix this by passing ‘Access-Control-Allow-Origin’ header .

Open the file to which you are sending the ajax request and place this header in the beginning of file.

 

 

<?php header('Access-Control-Allow-Origin: *'); ?>

Revisions

No comments yet.

Leave a Reply