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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Jquery, Mootools, Prototype or Plain Javascript?

4 点作者 mrfish超过 15 年前
I love to make fun UI's with Javascript. I primarily use jquery because it is well documented with examples and works across multiple browsers, it's easy and I havn't learned the other frameworks enough to give it a fair comparison. Comparied to native Javascript, I know what the benefits are and recently I've been exposed to Mootools which appears on the surface to have less functions.<p>So my question is, what's the difference? and when would I choose one over the other?

5 条评论

yannis超过 15 年前
The best library to use is the one you KNOW best. As you have already experience with jQuery, my suggestion is you stick with it. In any case IMHO it is the best JavaScript library in any case.<p>Things to experiment with besides jQuery:<p>(01) Base2<p>(02) YUI<p>These have helped me learn better JavaScript. YUI is an excellent library, but I can't stomach their namespacing, it is just too long for me, whereas Base2 have helped me learn a few things about better object orientated scripting.<p>The best advantage for jQuery for me is that I can remember almost all the methods. I rarely need to look up things and by now, I can also open up jQuery itself and I understand how it is working. The sizzle engine that it currently uses is one of the fastest selector engines.
aasarava超过 15 年前
I recently had to compare jQuery, YUI (2.0), and Ext for a project heavy on AJAX, client-side data sorting and filtering, and dynamic graphing. Here's my take on them. (Note that I already knew jQuery and was looking at YUI and Ext as potential replacements because of their extensive widget sets.) ::<p>- YUI has a lot of nice widgets, but the organization of its documentation made it hard to learn. Moreso, YUI doesn't make <i>writing</i> JavaScript any easier. I found myself writing dozens of lines of code to do seemingly simple things. And YUI 2.0 didn't seem to have as simple a way to query the DOM as jQuery.<p>- jQuery is at its core a framework that makes writing cross-browser JavaScript very easy, with very few lines of code. And the jQuery UI add-ons and plugins provide the widgets. Unfortunately, the plugins aren't consistent and they trail behind YUI and Ext in terms of features. But I felt like a jQuery expert in just a couple hours and can't imagine writing complicated scripts without it anymore.<p>- Ext has a very extensive, professional set of widgets (datatables, datepicker, charts, etc., etc.). It also seems to provide DOM querying in ways that are as simple as jQuery's. But the widgets feel very "heavy" and Java-like to me, rather than light and JavaScript-like. I found that I often couldn't write my own js or CSS to manipulate a widget after it was rendered; I had to use the widget's events and hooks. Hence, sometimes it just feels "heavy." Note also that Ext 3.0 doesn't have very good documentation yet, even though it's the default package available on the site.<p>Ultimately, I ended up mixing jQuery and Ext to get the framework/querying from the former and widgets from the latter.
评论 #853118 未加载
steerpike超过 15 年前
For UI heavy stuff you might be interested in looking at extJS: <a href="http://www.extjs.com/" rel="nofollow">http://www.extjs.com/</a> which seems to have some nice widgets built in.<p>I'm also a jquery advocate, but you can get a fairly useful indication of how different frameworks are set up here: <a href="http://mankz.com/code/GlobalCheck.htm" rel="nofollow">http://mankz.com/code/GlobalCheck.htm</a>
releasedatez超过 15 年前
+1 for jQuery. To me, it's one of the best thing that happens to me in my developing career. A lot more miles with a lot less fuel.<p>One thing I may suggest tho is that if you have a page that gets hit with a lot of traffic, you might consider out sourcing you jJavaScript.Query file or just use plain
joeld42超过 15 年前
You already use and like jQuery. It's good. It works. You know it. Stick with it.