safiot safiot - 11 months ago 53
jQuery Question

jquery: how to check if a page is performing an ajax request?

I want to build a function that fires with every ajax request. Like showing "loading...". I am using Jquery is that possible?

Answer Source

Yes, this is totally possible. Start with the global ajax handlers here .ajaxStart() and .ajaxStop() events are the most likely candidate to show your status indicator.