This sounds a lot like Deferred/Promise APIs. +1

Julian Aubourg wrote:
> Yeah, $.ajax already returning jQuery(xhr) would be awesome, but talk
> about backward compatibility breakage... the real question being: how
> many actually do use the xhr as a returned value (as opposed to
> beforeSend for instance).
>
> I have a question though... would
> jQuery(jQuery.get("url")).bind("success", fn); work if the request
> succeeds before the binding?
>
> 2009/11/9 John Resig <[email protected] <mailto:[email protected]>>
>
>     > Jason, I like what you're getting at.. a lot.
>
>     I agree, I like it as well.
>
>     A completely different technique:
>
>     jQuery(jQuery.get("url")).bind("success", fn);
>
>     Then the jQuery.ajax method could call jQuery(xhr).trigger("success");
>
>     Hmm. It'd be neat if we could somehow return just jQuery(xhr) but
>     that's not really possible, not without breaking code, at least.
>
>     --John
>
>     --
>
>     You received this message because you are subscribed to the Google
>     Groups "jQuery Development" group.
>     To post to this group, send email to [email protected]
>     <mailto:[email protected]>.
>     To unsubscribe from this group, send email to
>     [email protected]
>     <mailto:jquery-dev%[email protected]>.
>     For more options, visit this group at
>     http://groups.google.com/group/jquery-dev?hl=en.
>
>
>
> --
>
> You received this message because you are subscribed to the Google
> Groups "jQuery Development" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/jquery-dev?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en.


Reply via email to