热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

MooTools和JQuery并排-MooToolsandJQuerySidebySide

IjustinheritedsomewebpageswhichusesMooTools.IneverusedMooTools.NowIneedtoaddsomef

I just inherited some web pages which uses MooTools. I never used MooTools. Now I need to add some functions on the page, I wonder if it's a good idea to use jquery and mooTools on the same page?

我刚刚继承了一些使用MooTools的网页。我从未使用过MooTools。现在我需要在页面上添加一些函数,我想知道在同一页面上使用jquery和mooTools是个好主意吗?

Basically, I have 3 options,

基本上,我有3个选项,

  1. Convert the pages to JQuery, which I have to learn MooTools to do that.
  2. 将页面转换为JQuery,我必须学习MooTools才能做到这一点。

  3. Write new functions in MooTools. I have to learn even more MooTools to achieve this.
  4. 在MooTools中编写新功能。我必须学习更多的MooTools来实现这一目标。

  5. Use both on the page.
  6. 在页面上同时使用两者。

Your opinion will be appreciated.

您的意见将不胜感激。

10 个解决方案

#1


46  

Opinion: Learn MooTools and then move on with it. Sounds like a great opportunity to learn something new. Why introduce an entirely new library with addition js bloat if you don't need to. If it'll solve the problem you're golden.

意见:学习MooTools,然后继续学习。听起来像学习新事物的好机会。如果你不需要,为什么要引入一个带有附加js膨胀的全新库。如果它能解决问题你就是金色的。

#2


16  

MooTools is a perfectly solid and acceptable Javascript library and I'd recommend you add it to your list of known technologies rather than tear it out and replace with JQuery. Mixing the two is not a good idea as you're likely to encounter obscure difficult to debug conflicts.

MooTools是一个完全可靠且可接受的Javascript库,我建议您将其添加到已知技术列表中,而不是将其删除并替换为JQuery。混合这两者并不是一个好主意,因为您可能会遇到模糊的难以调试的冲突。

JQuery has had all the press of late, but it's by no means cut and dried that it beats every other library hands-down. Far from it. You might even find you prefer MooTools :-)

JQuery最近收到了所有的报道,但它并没有削减和干涸,它击败了其他所有图书馆。离得很远。您甚至可能会发现您更喜欢MooTools :-)

ADDED: For what it's worth my personal experience is that MooTools seems to play alongside other Javascript code more nicely than jQuery. I've been handling several sites of late which have mixed in MooTools with various other pieces of Javascript for different effects/functionality and it's all seemed to play along together with minimal issues. OTOH pages that use jQuery tend to use jQuery versions of everything. YMMV of course.

添加:值得我个人经验的是,MooTools似乎与jQuery相比更好地与其他Javascript代码一起使用。我一直在处理几个已经混合了MooTools的网站,其中包含各种其他Javascript的不同效果/功能,它们似乎与最小的问题一起发挥。使用jQuery的OTOH页面倾向于使用jQuery版本的所有内容。 YMMV当然。

#3


7  

Personally, I'd recommend not using both, as there are strange conflicts, even with jQuery.noConflict(). Go with one or the other.

就个人而言,我建议不要同时使用两者,因为即使使用jQuery.noConflict()也存在奇怪的冲突。一个或另一个去。

If you do end up using both, be sure to use jQuery.noConflict() to ensure that using the $ doesn't conflict.

如果你最终使用两者,请务必使用jQuery.noConflict()以确保使用$不会发生冲突。

Using jQuery with Other Libraries

将jQuery与其他库一起使用

#4


7  

i'd say, depends on how the code is structured and what you need to do. mootools does render itself to easy refactoring and extending (this is, after all, partly the reason it exists) but it takes a while to figure best practices and so forth.

我会说,取决于代码的结构以及您需要做什么。 mootools确实使自己易于重构和扩展(毕竟,这部分是它存在的原因)但是需要一段时间来计算最佳实践等等。

however, your learning curve from vanilla Javascript or jquery won't be too steep, especially so if all you care about is DOM mantipulation, event handling and effects. things get more interesting when you decide to write / extend mootools classes and venture into prototyping - but you may not have to do that...

然而,你的vanilla Javascript或jquery的学习曲线不会太陡峭,尤其如此,如果你关心的只是DOM的人为因素,事件处理和效果。当你决定编写/扩展mootools类并冒险进行原型设计时,事情变得更有趣 - 但你可能不必这样做......

there are some pretty good tutorials around for most things as well as some demos on doing things through jquery and mootools (equivalent ones). http://jqueryvsmootools.com/ is a good example on how the same task can be done through either one, i'd recommend reading it before deciding.

对于大多数事情都有一些非常好的教程,以及一些通过jquery和mootools(等效的)做事的演示。 http://jqueryvsmootools.com/是关于如何通过任何一个完成相同任务的一个很好的例子,我建议在决定之前阅读它。

whatever you decide, it is a bad practice to use two frameworks (when you can do without).

无论你决定什么,使用两个框架是不好的做法(当你没有框架时)。

#5


6  

It depends on how big a project it would be to convert to jQuery, how much of your job is maintaing these pages (vs other pages that already use jQuery), what the urgency is for your first set of changes, etc...

这取决于转换为jQuery的项目有多大,维护这些页面的工作量(与已经使用jQuery的其他页面相比),第一组更改的紧迫性等等......

It comes down to a cost comparison: how does the cost to your business to convert them to jQuery compare to the cost to the business for you to learn mooTools (and maybe keep both mootools and jquery in your head at the same time).

它归结为成本比较:您将业务转换为jQuery的成本与您学习mooTools的业务成本相比如何(并且可能同时保持mootools和jquery)。

The only thing I can say for sure is don't do option 3. This isn't necessarily because it you can't make it work (and there will be challenges), but because you'll have to learn mootools to properly maintain the pages anyway. Once you do that, you may as well just keep them mootools rather than re-write everything or try to mix frameworks.

我唯一可以肯定的是不做选项3.这不一定是因为你不能使它工作(并且会有挑战),但是因为你必须学习mootools来正确维护无论如何这些页面。一旦你这样做,你可能只是让他们保持mootools而不是重写所有内容或尝试混合框架。

Personally I'm inclined to say convert it jQuery, since I believe jQuery is eventually going to corner the market. The implication then is that it will convert to jQuery at some point, and so the long term costs to business are probably best optimized by doing the conversion earlier while there's less to convert and mootools is still relevant so you can easily get help with the conversion. But that's certainly arguable.

就个人而言,我倾向于将其转换为jQuery,因为我相信jQuery最终会在市场上占据一席之地。这意味着它将在某个时刻转换为jQuery,因此业务的长期成本可能最好通过更早地进行转换来优化,而转换的时间更少,并且mootools仍然相关,因此您可以轻松获得转换的帮助。但这肯定是有争议的。

#6


4  

jQuery and Mootools basics are close enough that moving from one to the other isn't much of a headache.

jQuery和Mootools的基础知识非常接近,从一个移动到另一个并不是一个令人头痛的问题。

Whenever I'm given the choice between the two, I lean towards Mootools - especially if I'm intending to do any sort of effects or animations. Mootools's base FX libraries are far more robust and generate better results cross-browser in my experience.

每当我在两者之间做出选择时,我倾向于Mootools - 特别是如果我打算做任何类型的效果或动画。根据我的经验,Mootools的基本FX库更加强大,并且可以跨浏览器生成更好的结果。

Like others have suggested, you could take this opportunity as a learning experience. If you're satisfied with jQuery and don't feel the need to learn another framework, port the code over. You can't really go wrong with either in the end.

像其他人建议的那样,你可以借此机会作为学习经历。如果您对jQuery感到满意并且不觉得需要学习另一个框架,请将代码移植到底。最后你不会真的出错。

#7


3  

Since you're more comfortable with jQuery, I would just call jQuery.noConflict(); first thing, and write the functions in jQuery. That is, of course, if time is a factor.

既然你对jQuery更熟悉,我只需要调用jQuery.noConflict();第一件事,并在jQuery中编写函数。当然,如果时间是一个因素。

#8


2  

There is a project that twists and prods Mootools to make it look like JQuery (a wolf in a sheep's clothing... or a golden coin painted to look like silver...)

有一个项目扭曲并刺激Mootools使它看起来像JQuery(穿着羊皮的狼......或者看起来像银色的金币......)

I certainly think you should learn Mootools, but that might help.

我当然认为你应该学习Mootools,但这可能有所帮助。

#9


1  

I agree with those that are in favor of learning mootols, but i think that is even better if your take that decision because you finally think that learning mootools worth it.

我赞同那些赞成学习mootols的人,但我认为如果你做出这个决定会更好,因为你最终认为学习mootools值得。

So i think it would be nice to have some research over mootools capabilities.

所以我认为对mootools功能进行一些研究会很好。

I like this articule about this subject. And I think it can be useful for those reading this thread.

我喜欢这个关于这个主题的关键词。我认为这对阅读这个帖子的人来说很有用。

http://jqueryvsmootools.com/index.html

#10


0  

I wrote a blog post about running the 2 side by side. http://chrisbarba.wordpress.com/2009/12/30/need-to-run-jq…s-side-by-side/

我写了一篇关于并排运行2的博客文章。 http://chrisbarba.wordpress.com/2009/12/30/need-to-run-jq...s-side-by-side/

I had no trouble getting it work in a SharePoint site. Chris

我在SharePoint网站上运行它没有任何问题。克里斯


推荐阅读
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • ZSI.generate.Wsdl2PythonError: unsupported local simpleType restriction ... [详细]
  • IhaveawebapplicationthatusesanActiveXCOMcomponent,forexample:我有一个使用ActiveXCOM组件的Web应用程 ... [详细]
  • 本文介绍了如何使用PHP向系统日历中添加事件的方法,通过使用PHP技术可以实现自动添加事件的功能,从而实现全局通知系统和迅速记录工具的自动化。同时还提到了系统exchange自带的日历具有同步感的特点,以及使用web技术实现自动添加事件的优势。 ... [详细]
  • Nginx使用AWStats日志分析的步骤及注意事项
    本文介绍了在Centos7操作系统上使用Nginx和AWStats进行日志分析的步骤和注意事项。通过AWStats可以统计网站的访问量、IP地址、操作系统、浏览器等信息,并提供精确到每月、每日、每小时的数据。在部署AWStats之前需要确认服务器上已经安装了Perl环境,并进行DNS解析。 ... [详细]
  • http:my.oschina.netleejun2005blog136820刚看到群里又有同学在说HTTP协议下的Get请求参数长度是有大小限制的,最大不能超过XX ... [详细]
  • Webmin远程命令执行漏洞复现及防护方法
    本文介绍了Webmin远程命令执行漏洞CVE-2019-15107的漏洞详情和复现方法,同时提供了防护方法。漏洞存在于Webmin的找回密码页面中,攻击者无需权限即可注入命令并执行任意系统命令。文章还提供了相关参考链接和搭建靶场的步骤。此外,还指出了参考链接中的数据包不准确的问题,并解释了漏洞触发的条件。最后,给出了防护方法以避免受到该漏洞的攻击。 ... [详细]
  • 拥抱Android Design Support Library新变化(导航视图、悬浮ActionBar)
    转载请注明明桑AndroidAndroid5.0Loollipop作为Android最重要的版本之一,为我们带来了全新的界面风格和设计语言。看起来很受欢迎࿰ ... [详细]
  • FeatureRequestIsyourfeaturerequestrelatedtoaproblem?Please ... [详细]
  • Android开发实现的计时器功能示例
    本文分享了Android开发实现的计时器功能示例,包括效果图、布局和按钮的使用。通过使用Chronometer控件,可以实现计时器功能。该示例适用于Android平台,供开发者参考。 ... [详细]
  • 欢乐的票圈重构之旅——RecyclerView的头尾布局增加
    项目重构的Git地址:https:github.comrazerdpFriendCircletreemain-dev项目同步更新的文集:http:www.jianshu.comno ... [详细]
  • 十大经典排序算法动图演示+Python实现
    本文介绍了十大经典排序算法的原理、演示和Python实现。排序算法分为内部排序和外部排序,常见的内部排序算法有插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序等。文章还解释了时间复杂度和稳定性的概念,并提供了相关的名词解释。 ... [详细]
  • Iwouldliketobeabletohaveasidebarthatcanbetoggledinandoutonabuttonpress.However ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • 本文介绍了如何使用iptables添加非对称的NAT规则段,以实现内网穿透和端口转发的功能。通过查阅相关文章,得出了解决方案,即当匹配的端口在映射端口的区间内时,可以成功进行端口转发。详细的操作步骤和命令示例也在文章中给出。 ... [详细]
author-avatar
mobiledu2502882453
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有