热门标签 | 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网站上运行它没有任何问题。克里斯


推荐阅读
  • 本文将介绍如何编写一些有趣的VBScript脚本,这些脚本可以在朋友之间进行无害的恶作剧。通过简单的代码示例,帮助您了解VBScript的基本语法和功能。 ... [详细]
  • Explore how Matterverse is redefining the metaverse experience, creating immersive and meaningful virtual environments that foster genuine connections and economic opportunities. ... [详细]
  • 使用 Azure Service Principal 和 Microsoft Graph API 获取 AAD 用户列表
    本文介绍了一段通用代码示例,该代码不仅能够操作 Azure Active Directory (AAD),还可以通过 Azure Service Principal 的授权访问和管理 Azure 订阅资源。Azure 的架构可以分为两个层级:AAD 和 Subscription。 ... [详细]
  • 本文详细介绍了Java中org.neo4j.helpers.collection.Iterators.single()方法的功能、使用场景及代码示例,帮助开发者更好地理解和应用该方法。 ... [详细]
  • 导航栏样式练习:项目实例解析
    本文详细介绍了如何创建一个具有动态效果的导航栏,包括HTML、CSS和JavaScript代码的实现,并附有详细的说明和效果图。 ... [详细]
  • 本文基于刘洪波老师的《英文词根词缀精讲》,深入探讨了多个重要词根词缀的起源及其相关词汇,帮助读者更好地理解和记忆英语单词。 ... [详细]
  • 本文深入探讨了 Java 中的 Serializable 接口,解释了其实现机制、用途及注意事项,帮助开发者更好地理解和使用序列化功能。 ... [详细]
  • 本文详细介绍了Akka中的BackoffSupervisor机制,探讨其在处理持久化失败和Actor重启时的应用。通过具体示例,展示了如何配置和使用BackoffSupervisor以实现更细粒度的异常处理。 ... [详细]
  • UNP 第9章:主机名与地址转换
    本章探讨了用于在主机名和数值地址之间进行转换的函数,如gethostbyname和gethostbyaddr。此外,还介绍了getservbyname和getservbyport函数,用于在服务器名和端口号之间进行转换。 ... [详细]
  • 本文详细探讨了JDBC(Java数据库连接)的内部机制,重点分析其作为服务提供者接口(SPI)框架的应用。通过类图和代码示例,展示了JDBC如何注册驱动程序、建立数据库连接以及执行SQL查询的过程。 ... [详细]
  • 本文详细介绍了如何解决Uploadify插件在Internet Explorer(IE)9和10版本中遇到的点击失效及JQuery运行时错误问题。通过修改相关JavaScript代码,确保上传功能在不同浏览器环境中的一致性和稳定性。 ... [详细]
  • 360SRC安全应急响应:从漏洞提交到修复的全过程
    本文详细介绍了360SRC平台处理一起关键安全事件的过程,涵盖从漏洞提交、验证、排查到最终修复的各个环节。通过这一案例,展示了360在安全应急响应方面的专业能力和严谨态度。 ... [详细]
  • 本文详细介绍了如何构建一个高效的UI管理系统,集中处理UI页面的打开、关闭、层级管理和页面跳转等问题。通过UIManager统一管理外部切换逻辑,实现功能逻辑分散化和代码复用,支持多人协作开发。 ... [详细]
  • 在使用 DataGridView 时,如果在当前单元格中输入内容但光标未移开,点击保存按钮后,输入的内容可能无法保存。只有当光标离开单元格后,才能成功保存数据。本文将探讨如何通过调用 DataGridView 的内置方法解决此问题。 ... [详细]
  • 本文详细介绍了 Java 中 org.apache.xmlbeans.SchemaType 类的 getBaseEnumType() 方法,提供了多个代码示例,并解释了其在不同场景下的使用方法。 ... [详细]
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社区 版权所有