I am trying to create an ajax request from my site to my server with an authorization parameter. My domains are not the same but this is handled in the java servlet of the server. The problem is if don't include the header parameter of the code below, the request reaches the server but gives an error of missing authorization header (obviously) BUT when I send the request with the header authorization, I get the "No 'Access-Control-Allow-Origin' header is present on the requested resource" error. Any ideas?
jQuery.ajax({
url: "someurl",
type: "POST",
headers:
{
"Authorization" : "some authorization",
},
complete: function(data)
{
// something
}
});