jQuery callbacks - short version

Posted by Frankie on Stack Overflow See other posts from Stack Overflow or by Frankie
Published on 2010-04-21T23:48:54Z Indexed on 2010/04/21 23:53 UTC
Read the original article Hit count: 371

Filed under:
|

I've dug the manual and tried extensivelly to drop the extra function(){...} call after the error and success to do it like mootools but to no good luck.

Is there any way i can avoid the extra function in jQuery?

function doFileDelete(ui) {
    $.ajax({
        error: function() { doFileDeleteAnimation(ui, false) },
        success: function() { doFileDeleteAnimation(ui, true) },
        url: '/url-to-delete-file'
    });
}

Thank you!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ajax