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.

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

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.

就功能而言,100101都可以轻松实现DOM Selection and Manipulation:

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

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

100101都支持轻松的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');

100101都允许轻松DOM Animation:

// 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);

100提供以下额外服务:

  • Large community of supporters
  • Plugin Repository
  • 与微软的ASP.NET和VisualStudio
  • 由微软、谷歌和其他公司使用

100提供以下额外服务:

  • Object Oriented Framework with Classic OOP emulation for JS
  • 扩展本机对象
  • Higher consistency between browsers for native functions support.
  • 更容易实现代码重用
  • 由万维网联盟、Palm和其他公司使用.

考虑到这一点,似乎100完成了101所做的一切,甚至更多(有些事情我在101年做不到,在100年我可以做到),但101的学习曲线更小.

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

Note:虽然我知道并承认100是一个很好的框架,但也有其他 Select ,我正试图决定为什么100应该是我们的 Select ,而不是我们现在使用的(102)?

推荐答案

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

  1. 您非常熟悉mootools,并充分利用其OOP模型,使您的代码更易于管理和支持.
  2. you realise that jQuery's purpose is somewhat different and tweaked towards DOM manipulation and AJAX and that mootools does do everything jQuery does AND then some.
  3. sounds as if you do not need to be using much in the way of 3-rd party plugins which makes the points of jQuery's popularity and support a bit less important.

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:

  • 框架生命周期 ,或者说,面对不断增长的jQuery,mootools可能会消失——非常值得怀疑,因为它们刚刚发布了1.3 beta 1,have 2.0正在准备年底发布.
  • cost of staff and their training (I imagine finding mootools programmers will be more difficult than these that slap jquery on their C.V / resume).
  • 在给定资源的情况下,在每个框架下维护和扩展系统所需的时间(和成本).

这两个框架都很棒,但我相信使用mootools最符合您的利益.

Jquery相关问答推荐

如果您的 Select 器对象无效,为什么 jQuery 不会炸弹?

动态加载 css 样式表在 IE 上不起作用

jQuery获取DOM node ?

在 JavaScript 中解析 URL

将变量传递给jQuery AJAX成功回调中的函数

一次替换多个字符串

JQuery手风琴自动高度问题

jQuery JSON到字符串?

jQuery绑定到粘贴事件,如何获取粘贴的内容

可以在删除类时反转css动画吗?

如何在 JQuery UI 自动完成中使用 source:function()... 和 AJAX

使用 jQuery Select 焦点文本在 Safari 和 Chrome 中不起作用

未捕获的 TypeError:data.push 不是函数

如何使用 jQuery 停止默认链接点击行为

与 C# HashSet 等效的 JavaScript 是什么?

带有回调ajax json的jQuery自动完成

使用 Jquery 查找父 div 的 id

自调用函数前的分号?

Drop 事件未在 chrome 中触发

如何使用 jQuery 处理复选框的更改?