11 ms·
I love how fast jQuery is progressing, but it does seem that ultimately the separations of various disciplines (particularly this .attr() and .prop() debate) is
by simonhamp 15y ago
I love how fast jQuery is progressing, but it does seem that ultimately the separations of various disciplines (particularly this .attr() and .prop() debate) is a step away from the convenience of jQuery-past.
It's understandable though, because helpers and abstractions add bloat and latency to interactions with the various DOM interfaces. And this latency is the price we have to pay for the benefits these abstractions give us - which include a unified interface to the DOM of many browsers.
The balance of speed vs convenience is very difficult for frameworks like jQuery looking to work for as many people as possible... if you want the convenience at the sacrifice of speed or conversely prefer the speed to the convenience you have one option: build a library specific to your app or your needs.
The rest of us will use jQuery ;)
- timdown 15y agoIn the case of attr(), the convenience jQuery was adding was an enormous fudge and attempted to gloss over the fundamental difference between attributes and properties, which has directly led to vast confusion and misunderstanding among developers. It was impossible for even jQuery core developers to explain what attr() was supposed to do. The pre-1.6 attr() was a design mistake that 1.6 is attempting to rectify, which must be a good thing (provided it's been done sensibly).