I have to correct my correcting: Both .attr({"height": "180"}) and .attr("height", "180") will call .height().
Still there still is big discrepancy between .attr({ click: function(){/*..*/} }) and .attr("click", function(){/ *..*/}) Adding that there is no (for now) symmetry between attr("height", ...) and attr("height") I am afraid, that I will not be the only confused one... On Dec 17, 7:50 am, Robert Katić <robert.ka...@gmail.com> wrote: > > > If we have > > > > $(xml).find("foo").attr("height", "180cm") > > > > then you would expect calling elem.setAttribute() and not .height(), I > > > hope. > > > If so, there is a bug in jQuery.attr()... > > > So we could disable it on XML documents - but regardless, that is > > definitely th exception. > > I have to correct me, that code will call elem.setAttribute(), but > > $(xml).find("foo").attr({"height": "180cm"}) > > will call .height() > > > Naturally, they aren't the case - the second is far superior. Setting > > a DOM 0 expando property is simply so substitute for binding events > > via jQuery. > > And you are completely fine with such discrepancy between > .attr({"height": "180"}) and .attr("height", "180"), > and between > .attr({ click: function(){ /*..*/ } }) and .attr("click", function(){ / > *..*/ }) ? > > > Because bind can take an object that can set multiple events > > simultaneously. .bind({ click: fn, mouseover: fn2 }) > > Anyway I would remove that just because there is .bind({...}) and .attr > ({...}) for setting multiple events simultaneously. .attr({ bind: > {...} }) is certainly dirty. Also "bind" is an action, not an > "attribute". -- 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.