Morales
Morales

Reputation: 138

Is there an event sent while ajax call is executed?

I need to receive information every time when ajax call is executed on specific page (since there are couple of them and after every one I need to bind handlers again). I would love to catch a generic event which occurs after every ajax call done on this page, is it somehow easily possible?

Upvotes: 0

Views: 69

Answers (1)

T.J. Crowder
T.J. Crowder

Reputation: 1074168

I need to receive information every time when ajax call is executed on specific page...

You can do that by registering global handlers via $.ajaxSetup.

since there are couple of them and after every one I need to bind handlers again

This suggests you might want to look into using event delegation instead of direct event handling. It's usually (but not always) possible to handle the event on a parent element, filtering when the handler is fired via the selector optional argument to on.

Upvotes: 2

Related Questions