Search posts, tags, users, and pages
No, jQuery will never die.
At least, typing $('#myID'); is faster than document.getElementById('myID'); anyway.
Haha, yes you 're right it's faster. The truth is we all love jQuery so we probably feel sad about this. Probably it won't die but its usage will drop because of ECMAScript and css evolution.
function _id(id) {
return document.getElementById(id);
}
...
_id('myId');
Well.. That argument is settled now.
Yes!!!
If you really want the $('#myID') syntax, you can do: var $ = document.querySelectorAll.bind(document);
I do not think jQuery is faster than naive DOM implementation. As a matter of fact, jQuery is slower since it uses document.getElementById if document.querySelector is not supported (older versions).
Janet Brown is talking about typing it Phil Ad, not load performance. Having said that if you use Atom or Sublime or some other IDE (even DreamWeaver) you have autocomplete so Janet Brown's argument is moot regarding typing the commands.
JQuery will always be slower in performance than vanilla JS.
JQuery will die eventually, simply because users don't want to wait for their app or browser page to load. Why load a bloated library to use $("#myid").css({background-color: #ccc}) when you can use the W3C compliant document.getElementById("myid").style.backgroundColor = '#ccc' without any extra overhead?
JQuery is great for small projects but, in 2018, to maintain a small footprint and have a codebase that is easy to port to different platforms/devices it's best to use the standard DOM manipulation libraries. JQuery tends to become spaghetti like and hard to maintain.