> Well, I have to admit that I am not too happy in which direction attr > () is going. > Adding to much magic is not simplifying the API to me. > If we (John) wont an method that can do everything (including > bindings!), than I would prefer it as an separate method ("set()" ?) > leaving rest of API as much as possible consistent and well defined.
I disagree. Being able to set all the (useful) properties of a DOM element via a single object structure can be very useful - and I see no reason not to overload the existing .attr() behavior if it already covers most of the functionality well and if there are no conflicts. I especially think that it's important to integrate it into .attr() so that we can effectively deprecate "bad" ways of setting DOM attributes or properties. For example, instead of doing .attr("innerHTML", "some html") we can offer the much saner .attr("html", "some html") same with .attr("onclick", fn) becoming .attr("click", fn) - both of these are removing the weirdness of the existing DOM APIs by providing something that's much better. Placing this in a separate function creates un-needed ambiguity. I dislike it for the same reason that I dislike having an extra .prop() method for setting just DOM object properties. We should be able to provide a unified API for setting information (called 'attr' in jQuery, mostly for legacy reasons - it actually was 'set' back when jQuery was first released) and work to meet the user's expectations based upon that. > Unfortunately, for me, it seams that jQuery API is going to prefer > beginner users with cost of ignoring true potentials (i.e. live()). How's that? .live() has seen considerable improvements since 1.3.2 both in the form of features (context limiting, data support), cross browser compatibility (submit, change, focus, blur, mouseenter, mouseleave), and performance (huge speed-ups to .closest() and node checking). As far as I know I've also landed every patch you've submitted to the jQuery Github fork queue. Perhaps there's something else that you're not divulging? --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-...@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.