php


No 'Access-Control-Allow-Origin' header is present on the requested resource. But when I check headers it is set


I'm getting following error when trying to POST with AJAX to my script.
XMLHttpRequest cannot load http://nasseira.epizy.com/domPath.php. No 'Access-Control-Allow-Origin' header is present on the requested resource.
AJAX Call:
jQuery.ajax({
type: "POST",
url : "http://nasseira.epizy.com/domPath.php",
data: {json: JSON.stringify(allMyPath)},
success: function (data) {
console.log(data);
},
error: function(){
console.log("Error");
}
});
PHP Script:
<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Credentials: true ");
header("Access-Control-Allow-Methods: OPTIONS, GET, POST");
header("Access-Control-Allow-Headers: Content-Type, Depth, User-Agent, X-File-Size,
X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control");
return print "ok";
?>
However when I check the headers it seems to be set correctly:
http://i.imgur.com/rRwBRmU.png
What am I doing wrong?

Related Links

preg_replace and hidden chars or hidden encoding
BelongsToMany with BelongsToMany relation [closed]
What is equivalent of strtotime in SQL?
Expecting statement after if
Extract array from inside array
How to group from MySQLi using PHP
How to file_get_contents from HTTPS with basic authentication?
WordPress custom taxonomy query
Server Concurrency with High CPU Load
Localhost and 127.0.0.1 show different content in web browser
wordpress - Injecting script with wp_head testing if already exit
Why am I getting error class ImagePixel not found?
PrestaShop AdminController - is there better way to preserve backslashes and html entites?
Extension-Issue with jenssegers Laravel Plugin for mongoDB?
WordPress: Functions inside while loop with variable in the name
How to access url project in server by public?

Categories

HOME
entity-framework
webview
macos-sierra
blast
typelite
adfs3.0
bokeh
concurrency
code-formatting
plpgsql
docker-cloud
portable-class-library
native-base
port
yeoman-generator-angular
locationmanager
nest-api
user-defined-types
tomcat8
gmp
angular2-highcharts
node-webkit
bosun
quantitative-finance
ratio
environment
fusetools
data-collection
high-availability
offline-caching
openbravo
bonita
xenapp
osx-lion
android-collapsingtoolbar
winrm
jfxtras
wdk
jslint
unification
git-tfs
nuclio
spongycastle
rm
image-registration
network-protocols
http4s
elastic4s
deviare
xcode6.4
bilinear-interpolation
gcloud-node
coovachilli
perforce-integrate
bbc-micro
ajaxmin
codecharge
i2b2
psd
openmrs
android-expansion-files
vim-plugin
diawi
msgpack
unhandled
roxygen2
karma-coverage
mxe
debug-symbols
nhibernate-criteria
famo.us
string.format
libgcc
otl
treeline
coding-efficiency
tabletools
mft
progress-db
mute
blobstorage
proc-open
border-box
system-information
series-40
autosize
wcf-callbacks
acpi
n-queens
webresponse
dip
ntruencrypt
twitter-feed
objectinstantiation
error-detection

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App