I don't think that the method name is at question here, but rather the
unnecessary performance cost of querying a selector before DOMReady
(or even after), ie. $('#anything'), when it is not needed for the
event delegation pattern. The .live method uses only the .selector
property of the jQuery instance and not the actual collection of DOM
elements, so there is no reason to query the DOM, especially before it
is even available.

Also, @robert, my solution supports the following notation, similar to
yours but using the familiar jQuery syntax (before/after DOMReady):
$.live("#mySelector", "click", fn1)
  .live("#mySelector", "mouseover", fn2)
  ...;

as well as (after DOMReady):
$("#mySelector").css("color", "#ff0000")
  .live("click", fn1)
  .live("mouseover", fn2);

--

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.


Reply via email to