-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cordova can not access to AJAX #73
Comments
Is localhost:8000 included in the Access-Control-Allow-Origin header? |
@janpio , hi, how can i do it ? |
How you can find out if it is? Look at the server code generating the response. If you don't control the server, the response is most probably no, but you can check using your browser's dev tools's network panel where you can look at the headers of the response. |
@janpio ,I can use below header method in my php codes and it works fine but it does not secure! |
You don't have to put This is a CORS problem, so you might have or not have the same problem on native platforms depending on how exactly the request is sent. Hard to predict, you best try it out. |
@salehmosleh think that you need to include connect-self on the security policy meta, including the host, something like: https://github.com/benitogf/hotpot/blob/master/client/src/index.pug#L8 |
Is stating that whatever server you're trying to access is being blocked because they have CORS enabled and you're server isn't the allowed origin. The server needs to send the MDN has a good resource that explains everything you need to know about CORS. I've also written a blog post on this, while the subject is about iOS and the WKWebView... the CORS concept is still the same. I'm closing this because this is not a bug with Cordova. |
i'm using Browser platform of Cordova, also i'm using
cordova-plugin-whitelist
andContent-Security-Policy
tag into my html codes. but i get below error in console:here is my config.xml:
and here is the meta tag:
and here is my ajax request:
how can i fix it?
The text was updated successfully, but these errors were encountered: