jQuery: The Write Less, Do More JavaScript Library

Binding .live() to document.body

View: New views
2 Messages — Rating Filter:   Alert me  

Binding .live() to document.body

by John Resig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This has been discussed before but I was just curious if this would
affect anyone negatively. I'd like to make this change so that less
bubbling has to occur (both documentElement and document no longer
have to get hit).

Roughly, the line in the .live implementation would end up being changed from:
  jQuery( this.context )

to:
  jQuery( this.context.body || this.context )

(Thus it would only use the body element on HTML documents, as well.)

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



Re: Binding .live() to document.body

by John Resig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Also, landing the change will fix this bug:
http://dev.jquery.com/ticket/3861

(where right and middle clicks also show up in live)

--John



On Sat, Nov 7, 2009 at 5:14 PM, John Resig <jeresig@...> wrote:

> This has been discussed before but I was just curious if this would
> affect anyone negatively. I'd like to make this change so that less
> bubbling has to occur (both documentElement and document no longer
> have to get hit).
>
> Roughly, the line in the .live implementation would end up being changed from:
>  jQuery( this.context )
>
> to:
>  jQuery( this.context.body || this.context )
>
> (Thus it would only use the body element on HTML documents, as well.)
>
> --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@....
To unsubscribe from this group, send email to jquery-dev+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.