Answer the question
In order to leave comments, you need to log in
AJAX request to server in Cordova/Phonegap app?
Help me, the bottom line is, I created a cordova application, connected JQuery, now I want to send an AJAX request to my server and return the results from the server. The result is the following
XMLHttpRequest cannot load http://my site. The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Origin 'null' is therefore not allowed access.
header('Access-Control-Allow-Origin: *');
$('#login').click(function(){
var id=localStorage.userName;
alert(id);
$.ajax({
url:'http://web-candy.ru/new/adm/ajax-app/login.php',
type:'POST',
data: {'id':id},
crossDomain: true,
success: function(res) {
alert(res);
}
})
})
Answer the question
In order to leave comments, you need to log in
Here is what I have in config
<access origin="*" subdomains="true" />
<allow-navigation href="*"/>
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question