views:

57

answers:

3

In JQtouch, any link is automatically convert into ajax call. I want to detect the moment the ajax call was send. This is so that i could insert a loading screen to let users know that the system is processing the submission.

I search through jqTouch API and apparently they only have callback events for page animation. Am i missing out on anything?

+1  A: 

You can use the core jQuery global AJAX functions, for example $.ajaxStart() for the start of a batch of requests, or $.ajaxSend() to detect the beginning of each request. Something like this:

$(document).ajaxSend(function() {
  alert("Request sending...");
});
Nick Craver
+1  A: 

Ready up on jQuery's Ajax Events: http://docs.jquery.com/Ajax_Events .

You may bind these to elements as follows:

$("...").bind("ajaxSend",myFunction) ;

every element specified this way will then react to a Ajax call being made with the specified callback function.

FK82
A: 

You need to ask the browser.

Brandon_R