0
Explaining better, in Eclipse PHP I have Project 1 and Project 2, and I am emulating PHP in Xampp, I wanted to send a Post via Ajax from Project 1 to Project 2, but I’m not getting it.
Error:
XMLHttpRequest cannot load http://localhost/appread/Post.php.
Response for preflight is invalid (redirect)
Ajax code:
$('#btn-sinc').click(function(){
$.ajax({
type: "POST",
url: 'http://localhost/appread/Post.php',
data: "cliente="+ClienteStorage,
contentType: "application/json; charset=utf-8",
dataType: 'json',
success: function (data){
alert('Dado Enviado');
}
});
});
I’m pretty sure the code isn’t quite right. If anyone can lend a hand I’d appreciate it.
give a read: https://d-mueller.de/blog/cross-domain-ajax-guide/
– novic
Thank you @Virgilionovic
– Wagner Viana