0

jquery コードから次の応答を返したいと考えています。

function count_waiting(){   
    $.ajax({                                                    
      url: 'index.php/event/count_waiting/2',                           
      type: "post", 
      success: function(response) {         
       return response;     
      } 
    });

}   

これを行うことにより、リターンは undefned です

$(document).ready(function() {
  alert(count_waiting());
});

私のコードの何が問題なのか

4

1 に答える 1