YUI recommends YUI 3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

Yahoo! UI Library

YAHOO Global  2.5.1

Yahoo! UI Library > yahoo > YAHOO

Show Private Show Protected

static Class YAHOO

The YAHOO global namespace object. If YAHOO is already defined, the existing YAHOO object will not be overwritten so that defined namespaces are preserved.



static void augment ( r , s , arguments )
An alias for YAHOO.lang.augment
r <Function> the object to receive the augmentation
s <Function> the object that supplies the properties to augment
arguments <String*> zero or more properties methods to augment the receiver with. If none specified, everything in the supplier will be used unless it would overwrite an existing property in the receiver
Returns: void


static void extend ( subc , superc , overrides )
An alias for YAHOO.lang.extend
subc <Function> the object to modify
superc <Function> the object to inherit
overrides <Object> additional properties/methods to add to the subclass prototype. These will override the matching items obtained from the superclass if present.
Returns: void


static Boolean log ( msg , cat , src )
Uses YAHOO.widget.Logger to output a log message, if the widget is available.
msg <String> The message to log.
cat <String> The log category for the message. Default categories are "info", "warn", "error", time". Custom categories can be used as well. (opt)
src <String> The source of the the message (opt)
Returns: Boolean
True if the log operation was successful.


static Object namespace ( arguments )
Returns the namespace specified and creates it if it doesn't exist
Either of the above would create YAHOO.property, then YAHOO.property.package Be careful when naming packages. Reserved words may work in some browsers and not others. For instance, the following will fail in Safari:
This fails because "long" is a future reserved word in ECMAScript
arguments <String*> 1-n namespaces to create
Returns: Object
A reference to the last namespace object created


static void register ( name , mainClass , data )
Registers a module with the YAHOO object
name <String> the name of the module (event, slider, etc)
mainClass <Function> a reference to class in the module. This class will be tagged with the version info so that it will be possible to identify the version that is in use when multiple versions have loaded
data <Object> metadata object for the module. Currently it is expected to contain a "version" property and a "build" property at minimum.
Returns: void

Copyright © 2007 Yahoo! Inc. All rights reserved.