Well I think global should probably mean global and not attached to
anything but the jQuery object. Perhaps sometimes I don't want or need
to have an ajaxSuccess method be attached to a DOM node. The only way
I think having it like this:
$('#msg').ajaxStart(...
makes sense is if mutliple global handlers can be attached.

Brandon

On 9/24/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> 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/
>

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

Reply via email to