O'Reilly logo

Liferay User Interface Development by Frank Yu, Xinsheng Chen, Jonas X. Yuan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Why YUI3?

YUI3 is the next-generation JavaScript and CSS library of Yahoo!. YUI has been used to write the Yahoo! website pages. All YUI code is under the Berkeley Software Distribution (BSD) license. The public can use it and contribute to it.

A sample piece of YUI3 code is like this:

YUI().use('node', function(Y) {
var node = Y.one('#greet');
node.setContent("Hi, I am YUI3.");
});

YUI3 uses the notion of sandbox. Your UI code is encapsulated in a sandbox. In the previous code snippet, this is the sandbox:

YUI().use('node', function(Y) {
// your code here
});

Here YUI is a global object in the YUI3 library. YUI() will return an instance of the YUI class. The use method allows you to get the modules and load them into your YUI instance. The above ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required