Question: can you help me why it returns error.

part of code /publications/deleteItem/' + valueClicked works ok, i checked (proper item is properly deleted). 

```
var valueClicked = 123456;
$.ajax({
    type: "post",
    url: '/publications/deleteItem/' + valueClicked, // 100% works!
    success: function(xml) {
        alert('602!');
    }, 
    error:function (XMLHttpRequest, textStatus, errorThrown) {
        alert(errorThrown); // throwns undefined?!
    }

});

```

so, alert('602!') never exetutes...

Answer: 
There's nothing wrong with this jQuery code. The server simply didn't return a HTTP 2nn or 3nn response, but a 4nn or 5nn response. This will cause the error handler being invoked instead of the success handler.

You can use [Firebug](http://getfirebug.com)'s [*Net*](http://getfirebug.com/network) panel to check the response headers and the status.
Since you are trying to create a REST interface you should test direct calls for what do you want to do in the first place.

Let's imagine you domain is: <http://www.mydomain.com>

Try to call <http://www.mydomain.com/publications/deleteItem/123456> and see what is returned from the server. The most probably your server is doing a redirect or outputting some error,and that's the source of your problem.