Skip to content

Return promise skipping Ajax call

I have a function in a class like this that returns a promise for deleting an item:

function Delete(){
    // if( == ""){
    //   return ?;
    // }
    return $.ajax({
       ... ajax details ...

My question is, what do I return in order to ‘skip’ the ajax section which will validate to done so that I can do something like this (in another script):

  ... code to execute after item is deleted ...



Both of these seem work.

return $.when();
return true;

Thanks to the comments.

User contributions licensed under: CC BY-SA
5 People found this is helpful