Document

The document object in RightJS has the standard Observer interface, and it also handles the dom-ready event.

Document Ready

The dom-ready event in RightJS is simply called ready and you can assign a listener to it in any of the standard ways:

document.onReady(function() {...});
document.on('ready', function() {...});
document.observe('ready', function() {...});

This event can also be handled the same way with the window object.

Methods

observe, on, onReady

top ↑observe

observe(String name, Function callback[, args[, ...]]) -> document self

Description

The standard listeners attachment method

DEPRECATED: please use the shorter method on

Example

document.observe('ready', function() {...});

top ↑on

on(String name, Function callback[, arguments, ...]) -> document self

Description

The standard listeners attachment method

Example

document.on('ready', function() {....});

top ↑onReady

onReady(Function callback[, arguments[, ....]]) -> document self

Description

A shortcut method for on('ready', ...)

Example

document.onReady(function() {....});