TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Does anybody still use jQuery?

46 点作者 jsnathan大约 7 年前
I know that frameworks such as React and Vue have taken over most of the mindshare, but I still find jQuery easier to use and often more productive, especially for smaller websites.<p>Even when using a framework I usually include jQuery to smooth out the edges where the framework does not behave as I would have expected, or seems to make implementing a part of the intended UX awkward or complicated.<p>Is anybody else still relying on jQuery in some capacity, and if so, what value do you get out of it? Do you use it along with one of the major frameworks, or together with smaller libraries? And do you plan on dropping it soon?

26 条评论

sheraz大约 7 年前
Yes, and I love it.<p>In hindsight I have been guilty of resume-padding and falling prey to hype by choosing to build on technology not appropriate to the problems at hand. And I find myself reverting back to basics, with bits of new tech sprinkled in.<p>My reversions:<p><pre><code> - React, flux, redux ----&gt; jQuery and intercoolerjs when needed - Swarm, Kubernetes ----&gt; Just plain old docker on single machine, scale vertically with cores and memory when needed - Microservices first ----&gt; Django Monolith first, then break out microservice when needed - API Gateways (kong, Azure) ----&gt; Nginx reverse proxy with hand-edited configs. </code></pre> I can do this because I have chosen to work on niche problems and smaller markets. Scale is not my issue, even in very successful scenarios.<p>I see jQuery will have a place in my stack for some time to come. It just works (tm), and it plays well when I need to level-up with wither intercooler or yes -- backbone.<p>Another benefit is that it is a low barrier to entry for junior developers. It allows me to establish a baseline knowledge, and then mentor other things like workflow, code structure, and architectural things rather than chasing weird configuration things inside of webpack or the taskrunner-du-jour.
评论 #16562361 未加载
评论 #16563725 未加载
ukulele大约 7 年前
I would be surprised if a majority of new projects with a JavaScript library <i>weren&#x27;t</i> using jQuery. I personally moved on a few years ago and I suspect that&#x27;s the case with many people who respond on HN, but there are still plenty of valid use cases, particularly when JS needs are simple and backwards compatibility is really important.<p>If you&#x27;re doing projects with light functionality and already know jQuery cold, you really don&#x27;t gain much from React, Vue, et al for that project. You may gain something personally (career path, different way of thinking, etc), but that is a different topic.<p>For anything slightly above the basics, I&#x27;d recommend Vue as a great alternative to jQuery. No build tools required and it&#x27;s easy to stay in the realm of plain HTML, CSS, and JS. It also &quot;progresses&quot; really nicely if you have more complex needs later on -- that would be a main benefit over a tool like jQuery.
Vinnl大约 7 年前
What you used jQuery for hasn&#x27;t so much been replaced by React and what not, as it has by native Javascript. Most of the things you used to do through jQuery are done with regular Javascript (and DOM API&#x27;s) just as easy nowadays - depending on your browser demographics, of course, but will be fine most of the time.
INTPenis大约 7 年前
Of course. We&#x27;re not all mobile app developers on HN. Some of us still make small info sites, or prototypes. And me, I&#x27;m actually a backend sysop but my hobby of developing websites keeps me branching out. So I&#x27;ve never developed a web&#x2F;mobile app with a framework, and still use jquery for simple websites.
ronreiter大约 7 年前
You are right that jQuery is dying:<p><a href="https:&#x2F;&#x2F;trends.google.com&#x2F;trends&#x2F;explore?date=today%205-y&amp;q=jquery" rel="nofollow">https:&#x2F;&#x2F;trends.google.com&#x2F;trends&#x2F;explore?date=today%205-y&amp;q=...</a><p>5 years ago, jQuery was twice as popular than it is today. But I wouldn&#x27;t call it dead just yet. It&#x27;s a work in progress.<p>By the way - one of the things that killed jQuery is HTML5, it&#x27;s not only Vue and React for more advanced features, a lot of people used jQuery for basic DOM manipulation, which today you can probably get away with just fine with the HTML5 DOM API, since the addition of the querySelector APIs and things like CSS&#x27;s classList APIs.
quantumleap22大约 7 年前
Yes, for almost all projects I work on due to the plugin ecosystem. If size is a concern I will look at zepto, a smaller 80&#x2F;20 implementation of the jQuery API. And I almost always use intercooler.js to keep my js footprint small.
floatboth大约 7 年前
querySelector + classList + CSS transitions + fetch absolutely destroyed jQuery.<p>And Web Components are starting to destroy jQuery Plugins.
terelak大约 7 年前
The company I work at uses jQuery for most DOM manipulation. I&#x27;m a backend developer and already knew it a bit so it&#x27;s easier for me than using React for simple things. I don&#x27;t do any frontend outside of work, so I&#x27;ve never gone past the React tutorial on my own time, and I suspect many mainly-backend developers have a similar story.
zabowl大约 7 年前
Yes. I use it especially for Wordpress custom themes or small websites or web apps that rely on DataTables.
hambos22大约 7 年前
It depends on the project. For web applications and SPA I prefer using React. For ecommerce and smaller projects, the stack is jQuery for cross browser (and old browser) compatibility with the minimum effort.(And Vue for some commerce components like minicart, quickview etc)
Macha大约 7 年前
Not so much. It&#x27;s lost out at both ends. Larger projects end up with Vue (and before that Angular), and smaller projects end up with just VanillaJS due to support for APIs like document.querySelector(), window.fetch(), &lt;input type=&quot;date&quot;&gt;, etc.
rajangdavis大约 7 年前
I stopped using jQuery after I started a rather large Angular project 2 years ago.<p>Since then, I had one project where using jQuery and jQuery UI was dramatically easier than building out a datepicker input by hand; however, for everything else, vanilla js is my go to.
kylorhall大约 7 年前
Almost every older project I&#x27;ve worked on uses jQuery. Currently working on a large Rails app, some parts being 10 years old, and it&#x27;s the same story. Old code is jQuery, new code is not.<p>It was spectacular 10 years ago, but now it&#x27;s pretty much useless to me. Most everything either shouldn&#x27;t be done in javascript or has a native replacement – at least with polyfills and Babel that I need for all development. I would love to remove it, but it would take far too long and provide little customer benefit (remove the library download), so it&#x27;s only removed when something is refactored.
CosmicShadow大约 7 年前
I just use JQuery and a few other libraries as needed as I use ASP.NET MVC so that takes care of the backend, no need for ugly, complex JS, keep it as minimal and simple as possible. If things need to be done more intensely in front end I use Knockout which seems to be very good at what it does and doesn&#x27;t muck it up by offering more than it needs or is meant for.
no1youknowz大约 7 年前
I&#x27;m using jQuery for a platform that I am launching very soon. The javascript&#x2F;jQuery portion of it currently stands at 63k LOC. I would not be surprised when I finish, it&#x27;ll stand at over 100k LOC.<p>If I look at the number of open source 3rd party js libs that support it, they are around 180k LOC.<p>Eventually, I do see a project that ports over the entire js code over to ES6 and Vue.
i_dont_know_大约 7 年前
Absolutely! Different tools for different projects. If I&#x27;m building a &#x27;real&#x27; webapp (as in, something with users logging in and lots of data dependencies) I&#x27;ll use something like React, but if it&#x27;s a small project... it&#x27;s not at all worth setting up the infrastructure and maintaining it when a few lines of jQuery will do the job.
mythrwy大约 7 年前
Yes. I think it is faster to develop in general for small sites.<p>When it becomes very much not faster is when you have a bunch of jQuery poorly (or &quot;customly&quot;) organized and someone else has to wade back through.<p>Vue is awesome though, really liking it. Sometimes I use Vue and jQuery together to take advantage of jQuery plugins. Does this make me a bad person?
simion314大约 7 年前
Yes, it is a good tool for one of my projects where I need to cleanup some html, is very good for DOM manipulation. It is also a very good tool for simple webpages, If I have some mostly static thing that I need to show I can render that on the server with PHP and have jQuery insert it on the right place and handle some events,
scarface74大约 7 年前
Yes. I&#x27;m currently using JQuery+HandlebarsJS as a poor man&#x27;s model view framework. I create the interface with Handlebars + Bootstrap, use JQuery to call an api when necessary. The template also has the necessary JavaScript event&#x2F;function inline.
siquick大约 7 年前
Yes, still haven&#x27;t really ever seen the need to use React yet.
tugberkk大约 7 年前
Of course. It still works right? :) Probably there are experts on Jquery, and although they are probably learning new technologies, when needed they rely on their expertise.
paulgrimes1大约 7 年前
I&#x27;ve literally only used it for .animate() in the past 6 months. VueJS came and took over. Might be time to think about pulling jQUery out..
stctgion大约 7 年前
I use it alongside Marionettejs. Not my first choice of technology but works great for extending the framework with a plugin or two
throwaway180118大约 7 年前
As a matter of fact, I write terrible Javascript all the time throw jQuery all over the place.<p>My end users don&#x27;t care! YMMV
originalsimba大约 7 年前
&quot;have taken over most of the mindshare&quot;<p>Have you got numbers to support that? Because I think it&#x27;s wrong.
评论 #16563124 未加载
raymond888大约 7 年前
&quot;I know that frameworks such as React and Vue have taken over most of the mindshare&quot;<p>Marketing + meme.