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: 
open up the net panel in firebug and look at the response codes. successful response codes are 2xx or 3xx. 

also try changing the success and error callbacks as follows and report back what you get.

```
success:function(data, status, xml) {
    alert(status);
},
error:function(data, status, xml) {
    alert(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.