How to check the success of AJAX request for following chunk of code using Drupal.ajax() The following code makes and AJAX request using Drupal.ajax() function. What I want is to have some kind of callback that will be executed once the request completed, basically the 'success' parameter of usual jQuery AJAX request. Adding success = function(request, status) parameter doesn't help either, or maybe I did something wrong ther. So how could I get a success callback to this request?

var ajaxSettings = {
    url: eventEditFormUrl + '/nojs',
    selector: popContClass + '&gt;div.content',
    wrapper: popContClass + '&gt;div.content',
    event: 'add_event',
    method: 'html',
    progress: {
        type: 'none',
    },
    speed: 'fast',
    effect: 'fade',
};
var req = new Drupal.ajax(null, popContClass, ajaxSettings);
$(popContClass).trigger('add_event');
Could you provide more information on why the success function didn't work for you or what code you were using for it? This should work exactly like ajax settings in jquery Ajax since its just a passthrough, so your code would be something like this in your js:

$.ajax({
    url: eventEditFormUrl + '/nojs',
    selector: popContClass + '&gt;div.content',
    wrapper: popContClass + '&gt;div.content',
    event: 'add_event',
    method: 'html',
    progress: {
        type: 'none',
    },
    speed: 'fast',
    effect: 'fade',
    success: function(){
       $(this).html("woot.");
    }
});