is there a way in ajax to wait until ajax is done, before calling the function again? Only if a button was pressed during ajax request.
$(document).ready(function(){
$_button.on('click',function(){
//if ajax is running, wait until done!
init();
});
});
function init(){
//this function should be called again, when ajax is done
}
function ajax(){
..
//ajax code
..
}
Thanks a lot