Mike, I agree, right now there is no override mechanism. It would be
pretty
easy to add one though -- add an optional boolean argument
(supressGlobalResponders or something) on the ajax function, and then
check
its value before invoking the global responders. You could then utilize a
global
Andre, Zörn,
Those are both good ideas for overriding the global callbacks. I'd
like that capability.
Mike
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Hi folks,
which of the following examples of global ajax handlers make more sense
and are easier to understand?
$(#msg).ajaxSuccess(function(){
$(this).append(liSuccessful Request!/li);
});
or
$.ajaxSuccess(function(){
$(#msg).append(liSuccessful Request!/li);
});
With chaining:
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(liSuccessful Request!/li);
});
or
$.ajaxSuccess(function(){
$(#msg).append(liSuccessful
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
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.
AndreOn
the global responders for individual requests -- as Klaus points out, there
are often XHR requests that don't merit the user's attention.
You can't really override the global responders. If you declare
local handlers they are called in addition to the global methods, not
instead of them.
Mike