jQuery 1.3 has been released.
http://docs.jquery.com/Release:jQuery_1.3
One of the improvements in this release is the removal of all browser
sniffing. As I look at the internals I still see room for improvement,
but I am reassured that it is headed in the right direction for a
generalized scripting library.
Any thoughts?
It seems the .live() method is getting a lot of attention. At one
point, at least a year ago, I did quite a bit of experimenting with
the type of programming the .live() method allows. I thought it was is
a really neat idea, it avoids the window.onload problem in some ways
as handlers can be "attached" to elements before the elements appear.
It can even be quite efficient as the check if an element matches a
selector is only a check up the element's ancestors (no a search
through the whole document.) As long as the selectors are only allowed
to be reasonably simple, the whole library does not need to be very
big.
Technically, there are problems with event types that don't bubble. It
seems people have worked quite hard to get focus and blur working in
four or five recent browsers. Capture for standard-compliant browsers
and some IE-specific focus/blur-related events. There are other events
which don't bubble and so the .live() style cannot be used exclusively
which seems to put a damper on the .live() style idea to me. If I
adopted it then I would want to go all the way as it would make the
code clearer to have a single style of programming
If avoiding the window.onload delay is the goal then the listeners are
"attached" to elements before the elements even exist. This is
probably done in the <head> of the document and the <body> doesn't
exist. If this is the case and the <body> doesn't yet exist, then many
feature tests are not even possible.
I found that the .live() style didn't work so well with the concept of
a widget. Because the .live() handler is the Flyweight Design Pattern,
the widget needs to be sent to the handler. Since the clicked element
is sent as part of the event to the handler, it is possible to use
that element to determine the associated JavaScript widget backing
object. All this hunting around for things at the beginning of each
event was very unappealing to me.
Peter