3 ms·
From the perspective of a passionate user of Ember, jQuery is still relevant. The DOM API may be more consistent between browsers today than it was in 2006, but
by ralmidani 11y ago
From the perspective of a passionate user of Ember, jQuery is still relevant. The DOM API may be more consistent between browsers today than it was in 2006, but it is still needlessly verbose:
document.getElementById(id)
vs.
$('#' + id)
Let's not forget the lack of chainability in DOM element method calls:
el = document.getElementById(id)
el.method1()
el.method2()
vs.
$('#' + id).method1().method2()
Yes--to me at least--conciseness and elegance matter, now more than ever. A better DOM API does not mean the end of jQuery. In a similar vein, ES6 does not spell the end for CoffeeScript.
- bobince 11y agoOn the other hand, `$('#'+id)` fails when the ID contains dot or other characters that have special meaning in a CSS selector, and `$(selector)` is overloaded with `$(html)` causing common XSS injection issues in apps misusing it. jQuery's “Do What I Mean” philosophy jas introduced as many of its own bugs as it ever fixed in browsers; I wish there were a happy medium.