Created
March 25, 2013 11:17
-
-
Save stefanbc/5236463 to your computer and use it in GitHub Desktop.
Cross Domain Ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept'); | |
?> |
It could have been done from htaccess as well but in my case the file that was supposed to have this was called with ajax and somehow the htaccess wasn't taking it into consideration without this two headers.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why not from the .htaccess ?
Header add Access-Control-Allow-Origin "*"
?