March 22, 2011

Alert on jquery Ajax request

Question by danip

Can I make a function that runs each time an AJAX request is made ?

This is the function:

function Exec() {
    alert(1);
}

Update: The AJAX requests are made by other scripts I don’t need to modify!

Answer by Starx

Try this

$(document).ajaxStart(function(){                               
  alert(1);
});

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!