问题
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