在应用程序中将 jQuery 和 YUI 混合在一起,这很容易实现吗?

发布于 2024-07-07 10:00:50 字数 260 浏览 6 评论 0原文

我必须以这样的事实作为序言:我喜欢 jQuery 作为 JavaScript 语言扩展,喜欢 YUI 作为一组丰富的免费控件。 所以这是我的问题,如果我在我正在开发的 MVC 应用程序中将 jQuery 和 YUI 混合在一起,是否会出现任何问题。

我想使用 jQuery 来处理 DOM 上的繁重工作,并且想使用 YUI 来实现丰富的用户控件集。 这是一个内部应用程序,在我工作的组织之外永远不会出现。

如果有人有混合这两个框架的经验,我很想听听您的经验。

I have to preface this with the fact that I love jQuery as a JavaScript language extension and YUI as a rich set of free controls. So here is my question, is there going to be any problems down the line if I mix jQuery and YUI together in an MVC app I am working on.

I want to use jQuery for the heavy lifting on the DOM and I want to use YUI for the rich user control set. This is an internal application and will never see the light of day outside of the organization I work for.

If anybody has experience with mixing these two frameworks I would love to hear what your experience has been.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

白日梦 2024-07-14 10:00:50

从我自己开发小工具的一些经验来看,我过去使用过 YUI 丰富的控件集和 Prototype 来进行 DOM 操作,并且没有遇到任何问题。 不可否认,这是一个小工具,没有使用大量的控件。

即便如此,我总是犹豫是否要在我的 Web 项目中使用多个框架; 然而,如果您只使用 jQuery 的 DOM 功能和 YUI 的控制功能,那么我认为您没问题 - 那里并不存在真正的利益冲突。 另外,凭借 jQuery 的 noConflict() 模式和 YUI 的命名空间,这两个框架确实不应该互相胜出。

Speaking from some experience in developing a small tool myself, I've used YUI's rich control set with Prototype for DOM manipulation in the past and experienced no issues. Admittedly, this was a small tool that didn't use a wide array of the controls.

Even so, I'm always hesitant to use multiple frameworks on my web projects; however, if you're only using jQuery's DOM functionality and YUI's control functionality, then I think you're fine - there's not really a conflict of interest there. Plus, with jQuery's noConflict() mode and YUI's namespacing, the two frameworks really shouldn't trump one another.

荒人说梦 2024-07-14 10:00:50

这是一个老问题,但想添加一个关于此主题的 jQuery 文档的链接...

http://docs .jquery.com/Using_jQuery_with_Other_Libraries

This is an old question, but wanted to add a link to jQuery's doc on this topic...

http://docs.jquery.com/Using_jQuery_with_Other_Libraries

灯下孤影 2024-07-14 10:00:50

我经常将 jQuery 与 YUI 一起使用(jQuery 用于大多数事物,YUI 用于 UI 元素),没有任何问题。

请注意,YUI 3 将引入 jQuery 样式选择器和链接:

http://developer.yahoo.com/yui /3/

I regularly use jQuery with YUI (jQuery for most things, YUI for the UI elements) with no trouble.

Note that YUI 3 will introduce jQuery style selectors and chaining:

http://developer.yahoo.com/yui/3/

靖瑶 2024-07-14 10:00:50

我认为这不应该是一个问题,因为 YUI 全部包含在“命名空间”中,所以它不应该破坏任何东西(我不知道 jquery 是否会破坏 YUI 周围的东西,但只要它不扩展基本对象应该没有任何问题)。
我记得 Dustin Diaz 推出了一个类似于 jquery 的库,并围绕 YUI 构建:
http://www.dustindiaz.com/introducing-ded-chain/
我尝试立即下载,但该网站现已离线。

I think it shouldn't be a problem because YUI is all contained in "namespaces", so it shouldn't break anything (I don't know if jquery break things around YUI, but as long as it doesn't extend basic object there shouldn't be any problem).
I remember Dustin Diaz come out with a library similar to jquery and builded around YUI:
http://www.dustindiaz.com/introducing-ded-chain/
I tried to download it now, but the site is now offline.

孤独患者 2024-07-14 10:00:50

是的,将 jquery 与 YUI 一起使用绝对是可能的,特别是因为 jquery 和 YUI 都采取了强有力的措施来防止全局名称空间污染。
然而,实现这种组合不必要地提供了许多冗余功能。 我强烈建议您使用 YUI3,它提供了 Jquery 的大部分功能以及更多功能。 YUI3 具有更加清晰和简洁的语法,并且有很好的文档记录。
然而,您可能正在使用某些 jquery 插件,其 YUI 替代品不可用。 在这种情况下,我建议您查看 Jquery UI 或 wijmo 来满足您的 UI 需求,或者使用 UKI 等轻量级 UI 工具包。
或者,您也可以看看 ExtJS,它有一个可用的 Jquery 适配器,通过它您可以利用您对 jquery 的熟悉以及 extjs 的丰富小部件。

yes, using jquery along side YUI is definitely possible, particularly because both jquery and YUI have taken strong steps to prevent global namespace pollution.
However, implementing such a combination unnecessarily provides a lot of redundant functionality. I would urge you to use YUI3 which provides most of the functionality of Jquery and much more. YUI3 has a much more cleaner and succinct syntax and is very well documented.
However it is possible that you are using some jquery plugin, whose YUI alternative is not available. In such case I would recommend you take a look at Jquery UI or wijmo for your UI needs or,use a light weight UI toolkit like UKI.
Alternatively, you could also take a look at ExtJS that has a Jquery adapter available through which you can take advantage of your familiarity with jquery as well as the rich widgets of extjs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文