Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come the answer to every javascript question ends up being "jQuery" [closed]

I've been following the javascript questions here for the last few weeks, and I've found a common recurring theme.

Almost any question asked on here that involves JavaScript gets answered with:

  1. "jQuery can do that"
  2. "there's a plugin for that"
  3. "jQuery can make your bed for you."

Even questions referencing other libraries are answered by saying "Use jQuery instead".

Is jQuery replacing JavaScript as a whole?
This is a serious question. Are we really looking at JavaScripts future. Obviously this community has a strong bias towards jQuery (is that because there's alot of .NET developers?), but does the web development community as a whole share this bias?

like image 521
Chase Wilson Avatar asked Jul 27 '10 22:07

Chase Wilson


1 Answers

No, jQuery does not replace JavaScript, because it is JavaScript. But it helps you a lot, especially in selecting elements and applying functions on elements.

The probably most important argument for using jQuery: You don't have to think about cross-browser compatibility.
Seriously, the different JavaScript implementations in the browsers are driving me crazy.

But I also don't think jQuery should be used for everything. It depends on where (e.g. which browsers) the JavaScript is used and what you actually do.

And as I already answered on other question, you can only master jQuery if you understand JavaScript. It is very easy to write bad jQuery code if you don't understand how it works.

Update:

In fact in modern browsers you can already do stuff you normally used jQuery for, like using selectors or each(), natively in JavaScript, with document.querySelectorAll() and the array method forEach().
But this is the problem: In modern browsers. jQuery ensures that you can use the same API and don't have to care about the browser version.

like image 131
Felix Kling Avatar answered Oct 22 '22 00:10

Felix Kling