Updated YUI3 for YUI2

For those of you who are using my YUI 3 for YUI 2 emulation code, I want to share with you the latest, and perhaps final version. This version is very similar to what we are now using on Mint.com, where I have been successfully swapping back and forth between the mock YUI 3 and the real YUI 3.



  • Y.Base.create has been added
  • use YUI.add instead of YUI().add
  • Y.NodeList is now supported
  • Y.Event.attach and Y.Event.detach emulated
  • window resize event supported
  • the Y.mix function is fully emulated

There is definitely more, but the above is a good list of the major improvements.

Mocking YUI 3 in YUI 2

At Mint.com we have wanted for some time to upgrade to YUI 3. However, since YUI 3 is not backwards compatible with YUI 2, it is hard to justify taking the time to port a large codebase. To alleviate the cost of upgrading, we have decided on a two step approach. During the first phase we will convert our YUI 2 code to use YUI 3 syntax, then in the second phase when we ...

IE 8 Compatibility Issue with YUI 2 Selector Component

I realized recently, in my work on Mint.com, that the YAHOO.util.Selector.query function does not work properly in IE 8 compatibility mode when performing a search against the class and for attributes. The issue is that previous versions of IE defined these attributes names as className and htmlFor, while IE 8 changed them to follow the standard. And a faulty if statement in the selector component does not properly use the legacy names when developers ...