JQuery and YUI, can they live together?

狂风中的少年 提交于 2019-12-23 06:50:35

问题


Can JQuery and YUI live together w/o any conflicts?


回答1:


Yes. They live in different namespaces, plus jQuery has a noConflict option.




回答2:


Yes YUI3 uses YUI object, jQuery uses $. For instance you can use YUI 3 Test module and inside it using $ for DOM manipulation/traversing (I think jQuery is really good for those purposes), so for instance you can do:

YUI().use("test", function(){
    test : function() {
       $('div li').addClass("example");
       Y.Assert.areEqual("example", $('div li').attr("class"));
    }
});



回答3:


See also




回答4:


Sure, I do it when necessary.



来源:https://stackoverflow.com/questions/235236/jquery-and-yui-can-they-live-together

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!