Print Friendly

# Class YAHOO

Package: | Global
Class: | YAHOO
Extends: | Object
Defined In: | yahoo.js

The YAHOO global namespace object

## Public Properties

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---
| augment(`Function r`, `Function s`, `String* arguments`) : void | YAHOO
<static> Applies all prototype properties in the supplier to the receiver if the receiver does not have these p...
| extend(`Function subc`, `Function superc`, `String[] overrides`) : void | YAHOO
<static> Utility to set up the prototype, constructor and superclass properties to support an inheritance strat...
| log(`String msg`, `String cat`, `String src`) : Boolean | YAHOO
<static> Uses YAHOO.widget.Logger to output a log message, if the widget is available.
| namespace(`String* arguments`) : Object | YAHOO
<static> Returns the namespace specified and creates it if it doesn't exist YAHOO.namespace("property.package"...

## Public Events

This class has no public events.

## Method Details

### augment

`public function augment(`Function r`, `Function s`, `String* arguments`)`
<static> Applies all prototype properties in the supplier to the receiver if the receiver does not have these properties yet. Optionally, one or more methods/properties can be specified (as additional parameters). This option will overwrite the property if receiver has it already.
Parameters:

- `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`

This method is defined by YAHOO.

### extend

`public function extend(`Function subc`, `Function superc`, `String[] overrides`)`
<static> Utility to set up the prototype, constructor and superclass properties to support an inheritance strategy that can chain constructors and methods.
Parameters:

- `subc` : Function
  the object to modify
- `superc` : Function
  the object to inherit
- `overrides` : String[]
  additional properties/methods to add to the subclass prototype. These will override the matching items obtained from the superclass if present.

Returns:

- `void`

This method is defined by YAHOO.

### log

`public function log(`String msg`, `String cat`, `String src`)`
<static> Uses YAHOO.widget.Logger to output a log message, if the widget is available.
Parameters:

- `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.

This method is defined by YAHOO.

### namespace

`public function namespace(`String* arguments`)`
<static> Returns the namespace specified and creates it if it doesn't exist

    YAHOO.namespace("property.package");
    YAHOO.namespace("YAHOO.property.package");

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:

    YAHOO.namespace("really.long.nested.namespace");

This fails because "long" is a future reserved word in ECMAScript
Parameters:

- `arguments` : String*
  1-n namespaces to create

Returns:

- `Object`
  A reference to the last namespace object created

This method is defined by YAHOO.

Copyright © 2006 Jack Slocum. All rights reserved.