halfer schrieb:
> 
> Rafael Santos wrote:
>> Hmm.. i was looking at the docs, i couldnt find a $.ajaxXXX() function
>> that
>> could be used.
>>
>> I complement asking, what's the exactly difference between, ajaxStop,
>> ajaxSuccess, ajaxComplete ?
>>
> 
> @Rafael : jQuery ajax functions are here:
> 
> http://docs.jquery.com/Ajax
> 
> .ajax is a low-level call and so to start with, just use .get or.post, as
> they are simpler to use.
> 
> The Stop, Success and Complete functions are event callbacks to be used for
> all AJAX ops on your page (I've not used them - not needed to). The first is
> called when the last AJAX request has finished, Success is called when a
> call is successful (and bear in mind that a call may not be - eg the server
> may be down). And Complete is called at the end of an AJAX call regardless
> of whether it was successful. More info is available on the URL I provide
> above.

jQuery's success event handler doesn't map to readystate == 3, but if 
that is still required we can work with native JavaScript - let's 
utilise the fact that jQuery's $.ajax function returns the 
XmlHttpRequest object:

var xhr = $.ajax(...);
xhr._onreadystatechange = xhr.onreadystatechange;
xhr.onreadystatechange = function() {
     xhr._onreadystatechange();
     if (xhr.readyState == 3) alert('Interactive');
};



-- Klaus

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to