I am using 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 -
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
var result = xhttp.responseText;
deleteItemsIDsResult(result);
}
};
xhttp.open("POST", "ItemsIDsDelServlet", true);
xhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xhttp.send(data);
The data send to the servlet is -
itemsToBeDeleted=df,dxffx,fxd,fxdxd,fxf,dxfd,,®ion=swed&userid=edrf&pwd=rrff
Any leads please.
Thanks.