function ajax(){
$.ajax({
..
..
success:function(response){
}
});
}
$('button').click(function(){
ajax() <-- if success do after this
});
$('.button2').click(function(){
ajax() <-- if success do after this
});
I have few element that need to run a ajax function but how can I do a callback? since ajax is async I can't simply run something after the function.