我管理着一组程序员.我确实重视员工的意见,但最近我们对于在 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.
我同时使用了 jQuery 和 MooTools.这篇特别的文章倾向于反映我对这两个框架的看法.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.
功能方面,jQuery 和 MooTools 可以轻松实现 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');
jQuery 和 MooTools 允许轻松实现 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');
jQuery 和 MooTools 可以轻松实现 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:
MooTools 提供以下附加功能:
MooTools offers the following extras:
鉴于此,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...
底线,是炒作吗?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 上.
Both frameworks are great but I believe your interests are best served in staying with mootools.
这篇关于与其他 Javascript 框架相比,为什么 jQuery 被如此广泛地采用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!