I want to do something very simple. I have one button in my page.
$("#btnId").click(function(e){ e.preventDefault(); $.ajax({ ... beforeSend : function(xhr, opts){ //show loading gif }, success: function(){ }, complete : function() { //remove loading gif } }); });