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 <jere...@gmail.com <mailto:jere...@gmail.com>> > > > 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 jquery-dev@googlegroups.com > <mailto:jquery-dev@googlegroups.com>. > To unsubscribe from this group, send email to > jquery-dev+unsubscr...@googlegroups.com > <mailto:jquery-dev%2bunsubscr...@googlegroups.com>. > 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 jquery-...@googlegroups.com. > To unsubscribe from this group, send email to > jquery-dev+unsubscr...@googlegroups.com. > 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 jquery-...@googlegroups.com. To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.