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
- February 15, 2016 @ 16:22:19 [Current Revision] by admin
- February 15, 2016 @ 16:22:01 by admin
- February 15, 2016 @ 16:21:37 by admin
Revision Differences
February 15, 2016 @ 16:21:37 | Current Revision | ||
---|---|---|---|
Content | |||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: This topic will show you how to fix No ‘Access- Control-Allow- Origin’ header is present on the requested resource. | Unchanged: This topic will show you how to fix No ‘Access- Control-Allow- Origin’ header is present on the requested resource. | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: <strong>No ‘Access- Control-Allow- Origin’ header is present on the requested resource</strong> | Unchanged: <strong>No ‘Access- Control-Allow- Origin’ header is present on the requested resource</strong> | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: 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 . | Unchanged: 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 . | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: Open the file to which you are sending the ajax request and place this header in the beginning of file. | Unchanged: Open the file to which you are sending the ajax request and place this header in the beginning of file. | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: | Unchanged: | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <table> | Unchanged: <table> | ||
Unchanged: <tbody> | Unchanged: <tbody> | ||
Unchanged: <tr> | Unchanged: <tr> | ||
Unchanged: <td data-settings="show"> | Unchanged: <td data-settings="show"> | ||
Unchanged: <p> | Unchanged: <p> | ||
Deleted: 1 | Added: | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: </td> | Unchanged: </td> | ||
Unchanged: <td> | Unchanged: <td> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: <?php header('Access- Control-Allow-Origin: *'); ?> | Unchanged: <?php header('Access- Control-Allow-Origin: *'); ?> | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: </td> | Unchanged: </td> | ||
Unchanged: </tr> | Unchanged: </tr> | ||
Unchanged: </tbody> | Unchanged: </tbody> | ||
Unchanged: </table> | Unchanged: </table> |
Note: Spaces may be added to comparison text to allow better line wrapping.
No comments yet.