I think the global responders should be attached to the jQuery object rather than to a DOM element. That said, it's very useful to be able to override the global responders for individual requests -- as Klaus points out, there are often XHR requests that don't merit the user's attention.

Andre

On 9/24/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:


Jörn Zaefferer schrieb:
> Hi folks,
>
> which of the following examples of global ajax handlers make more sense
> and are easier to understand?
>
> $("#msg").ajaxSuccess(function(){
>   $(this).append("<li>Successful Request!</li>");
> });
>
> or
>
> $.ajaxSuccess(function(){
>   $("#msg").append("<li>Successful Request!</li>");
> });
>
> With chaining:
> $("#msg").ajaxStart(function(){
>   $(this).show();
> }).ajaxStop(function() {
>  $(this).hide();
> });
>
> or
>
> var msg = $('#msg');
> $.ajaxStart(function() {
>   msg.show();
> });
> $.ajaxStop(function() {
>   msg.hide();
> });
>
> Your opinion is appreciated.
>
> -- Jörn

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

Reply via email to