XHR failed loading: POST

XHR failed loading: POST

I am using J-Query Ajax to call a servlet which return a String message.
The servlet gets called successfully as I can see some println statements in my console.
But after that i get an error XHR failed loading: POST.

The code is-

$.ajax({
        type: "POST",
        url: "ItemsIDsDelServlet",
        data: data,
        success: function (data) {
        window.alert("done");
        },
        error: function (data) {
        window.alert("undone");
        }
    });

variable 'data' here contains itemIds separated by '%%' like "123%%345%%567".
The servlet returns a String "Deleted:10 NotDeleted:10".

The error is can see in the console is-

In the servlet I have used the below to forward the response-
PrintWriter out = response.getWriter();
out.println(output);

Any Leads please...