18

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

4 Answers4

10

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

Tom Ritter
  • 99,986
  • 30
  • 138
  • 174
  • 1
    well YUI doesnt' use the $ since that is bad practise anyways (according to Douglas Crowford) –  Oct 24 '08 at 21:05
6

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"));
    }
});
sebarmeli
  • 17,949
  • 7
  • 35
  • 40
2

See also

Community
  • 1
  • 1
Hank Gay
  • 70,339
  • 36
  • 160
  • 222
2

Sure, I do it when necessary.

Larry K
  • 47,808
  • 15
  • 87
  • 140