与其他 Javascript 框架相比,为什么 jQuery 被如此广泛地采用? [英] Why is jQuery so widely adopted versus other Javascript frameworks?

查看:24
本文介绍了与其他 Javascript 框架相比,为什么 jQuery 被如此广泛地采用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我管理着一组程序员.我确实重视员工的意见,但最近我们对于在 Web 项目中使用哪个框架存在分歧.

I manage a group of programmers. I do value my employees opinion but lately we've been divided as to which framework to use on web projects.

我个人喜欢 MooTools,但我的一些团队似乎想迁移到jQuery 因为它被更广泛地采用.这本身不足以让我允许迁移.

I personally favor MooTools, but some of my team seems to want to migrate to jQuery because it is more widely adopted. That by itself is not enough for me to allow a migration.

我同时使用了 jQueryMooTools.这篇特别的文章倾向于反映我对这两个框架的看法.jQuery 非常适合 DOM 操作,但似乎仅限于帮助您做到这一点.

I have used both jQuery and MooTools. This particular essay tends to reflect how I feel about both frameworks. jQuery is great for DOM Manipulation, but seem to be limited to helping you do that.

功能方面,jQueryMooTools 可以轻松实现 DOM 选择和操作:

// jQuery
$('#someContainer div[class~=dialog]')
    .css('border', '2px solid red')
    .addClass('critical');

// MooTools
$('#someContainer div[class~=dialog]')
    .setStyle('border', '2px solid red')
    .addClass('critical');

jQueryMooTools 允许轻松实现 AJAX:

// jQuery
$('#someContainer div[class~=dialog]')
     .load('/DialogContent.html');

// MooTools (Using shorthand notation, you can also use Request.HTML)
$('#someContainer div[class~=dialog]')
     .load('/DialogContent.html');

jQueryMooTools 可以轻松实现 DOM 动画:

// jQuery
$('#someContainer div[class~=dialog]')
    .animate({opacity: 1}, 500);

// MooTools (Using shorthand notation, you can also use Fx.Tween).
$('#someContainer div[class~=dialog]')
    .set('tween', {duration: 500}) 
    .tween('opacity', 1);

jQuery 提供以下附加功能:

jQuery offers the following extras:

  • 庞大的支持者社区
  • 插件库
  • 与微软的 ASP.NET 和 VisualStudio 集成
  • 由 Microsoft、Google 和其他公司使用

MooTools 提供以下附加功能:

MooTools offers the following extras:

  • 带有经典 OOP 模拟的面向对象的 JS 框架
  • 扩展原生对象
  • 本机功能支持的浏览器之间具有更高的一致性.
  • 更轻松的代码重用
  • 被万维网联盟、Palm 等使用.

鉴于此,MooTools 似乎无所不能jQuery 做了很多事情(有些事情我在 jQuery 我可以在 MooTools) 但 jQuery 的学习曲线较小.

Given that, it seems that MooTools does everything jQuery does and more (some things I cannot do in jQuery and I can in MooTools) but jQuery has a smaller learning curve.

所以问题是,为什么您或您的团队选择 jQuery 而不是另一个 JavaScript框架?

So the question is, why did you or your team choose jQuery over another JavaScript framework?

注意:虽然我知道并承认 jQuery 是一个很棒的框架,还有其他选择,我正在尝试决定为什么 jQuery 应该是我们的选择,而不是我们现在使用的 (MooTools)?p>

Note: While I know and admit jQuery is a great framework, there are other options around and I'm trying to take a decision as to why jQuery should be our choice versus what we use right now (MooTools)?

推荐答案

这是一个奇怪的问题...我的印象是...

That's an odd question... I get the impression that...

  1. 您非常熟悉 mootools 并充分利用其 OOP 模型,从而使您的代码更易于管理和支持.
  2. 您意识到 jQuery 的目的有些不同,并且针对 DOM 操作和 AJAX 进行了调整,并且 mootools 确实可以完成 jQuery 所做的所有事情以及其他一些事情.
  3. 听起来好像您不需要以 3-rd 方插件的方式使用太多,这使得 jQuery 的受欢迎程度和支持变得不那么重要了.

底线,是炒作吗?jQuery 正在变成像AJAX"、.NET 和 Web 2.0 这样的神奇营销流行语之一——这对他们来说非常棒,但是为什么 需要证明继续使用对你如此有效的框架是合理的?还有一些我认为会涉及到的商业考虑:

Bottom line, is it the hype? jQuery is turning into one of these magical marketing buzzwords like 'AJAX', .NET and Web 2.0 — which is great for them but why do you need to justify staying with the framework that works so well for you? There's also the business considerations which I imagine will cover things like:

  • 框架的寿命,或者 mootools 可能会在不断增长的 jQuery 面前消失 - 非常值得怀疑,因为他们刚刚发布了 1.3 beta 1 并且有 2.0 正在准备在今年年底发布.
  • 员工成本和他们的培训(我想找到 mootools 程序员会比那些在简历/简历上打 jquery 的人更难).
  • 在给定资源的情况下,在每个框架下维护和扩展系统所花费的时间(和成本).

这两个框架都很棒,但我相信你的兴趣最好还是留在 mootools 上.

Both frameworks are great but I believe your interests are best served in staying with mootools.

这篇关于与其他 Javascript 框架相比,为什么 jQuery 被如此广泛地采用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆