We are using jQuery to perform ajax calling. We use different methods – $.get, $.getScript, $.post etc.
I would like perform a session check on every ajax call and once session found function should proceed to perform what is define in it’s body. Rather to perform such check by explicitly call a function in every place where ajax method is used is there better way to this?
Hypothetically, assume all jQuery ajax methods have a base method, we can use that base to perform the session check. Is such thing possible?
Thanks.
I think you can use global ajax event handler:
source
======
I think you should use
ajaxSendevent:see here: http://docs.jquery.com/Ajax_Events
ajaxSendwill triggered on each ajax request, and