2

I am using a report viewer in My webpage. I have decided I need to add some custom abilities to it (ui wise). For that I've utilized some jquery libraries. Problem arises when the control sends ajax controls to the remote server. I need to somehow get notified about them, and raise a callback event when the request is complete.

Is this possible?

If so how?

1 Answer 1

14

You could use the $.ajaxSetup() function which allows you to register global properties for all ajax requests (issued by jQuery). For example:

$(function() { $.ajaxSetup({ complete: function(xhr, textStatus) { // will be raised whenever an AJAX request completes (success or failure) }, success: function(result) { // will be raised whenever an AJAX request succeeds }, etc ... you could use any available option }); }); 
Sign up to request clarification or add additional context in comments.

4 Comments

I am not sure why, but these events don't get reached. I am using a control that is not using jquery.
@vondip, OK, the fact that the control is not using jQuery explains why those events are never reached. I am afraid that you cannot achieve this in this case or there might be some browser specific extensions.
@vondip to globally detect AJAX calls using native javascript stackoverflow.com/questions/10783463/…
Here's what I use jquery.ajax.tracker

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.