"I'm curious why the selector even needs to be executed prior to
calling the live method"...
Probably so you can chain it.
$('p').live('click', function() { console.log('clicked!')}).css
({'color':'red'});
On May 9, 8:47 am, Zach Leatherman <[email protected]> wrote:
> Since we're using Event Delegation on the document object, I'm curious
> why the selector even needs to be executed prior to calling the live
> method. Why not make it a jQuery function instead?
>
> $.live = function(selector, type, fn)
> {
> var r = $([]);
> r.selector = selector;
> if(type && fn) {
> r.live(type, fn);
> }
> return r;
>
> };
>
> There might be some confusion with this approach, since the jQuery
> object being returned does not actually contain any nodes, but it's
> something to think about.
>
> Thanks,
> Zach Leathermanhttp://www.zachleat.com/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---