safiot safiot - 21 days ago 6
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

Yes, this is totally possible. Start with the global ajax handlers here http://api.jquery.com/category/ajax/global-ajax-event-handlers/ .ajaxStart() and .ajaxStop() events are the most likely candidate to show your status indicator.