Hi,
Does anyone know how to send data to an external server using AJAX without running into Cross Domain issues?
I am building an Ionic Application that connects my client application to an AWS server (EC2 instance) that contains PHP files and MySQL. I set up an Apache on my EC2 instance. I am having a cross domain issue when using AJAX post. I tried adding ‘http://www.corsproxy.com/’ to the AWS Public Domain but I get an error that CORS is not enabled. I followed these instructions to enable CORS on the Apache server http://enable-cors.org/server_apache.html but it does not seem to work.
$scope.process = function(){
$http({
method : ‘POST’,
url : ‘http://www.corsproxy.com/’ + ****AWS Public Domain
data : $.param($scope.formData),
headers : {‘Content-Type’ : ‘application/x-www-form-urlencoded’}
})
.success(function(data) {
console.log(data);cib
if (!data.success){
$scope.errorUname = data.errors.uname;
$scope.errorPword = data.error.pword;
} else {
$scope.message = data.message;
}
});
P.S. I am somewhat new to web development so any help is great