Im not sure why this error is thrown while making a server call on JQuery using Ajax.
My server code is
@POST
@Path("/update")
@Produces({ "application/json "})
public Response update(String json) {
......
ResponseBuilder builder = Response.ok("test");
builder.header("Access-Control-Allow-Origin", "*");
builder.header("Access-Control-Allow-Headers", "*");
return builder.build();
And my Jquery code is
var URL = "http://........";
$.ajax
({
type: "POST",
//the url where you want to sent the userName and password to
url: URL,
dataType: 'json',
success: function (data) {
alert("ok");
}
});
NOTE: The same code is working fine on Google App Engine.....