1

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.....

4

1 回答 1

1

Try in Firefox, Safari or IE. I had the same issue.

于 2013-03-31T12:15:53.637 回答