I've been trying for days to make this work:
$.ajax({
url: 'http://otherdomain.com/mail.json' ,
dataType: 'json',
data: jsonObject,
success: function(data){
alert("Thank you for your inquiry. We will get back to you soon.");
}
});
The mail.json
API works when I use the Chrome Postman app to test and the response header is this:
Accept-Ranges →bytes
Access-Control-Allow-Origin →*
Alternate-Protocol →80:quic,p=0.002
Cache-Control →private
Content-Encoding →gzip
Content-Length →22
Content-Type →application/json; charset=UTF-8
Date →Mon, 15 Sep 2014 05:18:09 GMT
Server →Google Frontend
Vary →Accept-Charset, Accept-Encoding, Accept-Language, Accept
What could be wrong in my Jquery code, as the server works fine.