I have a link that when i click on it will trigger an ajax call then replace this link by another link, says for example the original link is \"add friend\", when i click th
I had the same issue, and the problem is not with ajax:success or ajax:complete callback. The problem is that when displaying the loading gif image, you replace the content of the container, including the link itself. So the element on which you apply the success, complete callback is not part of the DOM anymore, that's why the callback is not fired.
One solution would be to hide the element and append the loading image, like following:
$('#my_link').on "ajax:send", (event, xhr, settings) ->
$('#my_link').hide()
$("#my_link_container").append(" ")
Then the success and complete callback will be fired. Hope it helps somebody :)