The global $ variable is an alias for getEBCS.
The global API variable is an object that encapsulates all library functions.
The absoluteElement function positions an element absolutely, preserving its position and size.
absoluteElement(el);
The addBookmark function calls on the browser to display its bookmarking (AKA favorites) dialog with the supplied location and title.
addBookmark(href, title[, win]);
The addBookmarkCurrent function calls on the browser to display its bookmarking (AKA favorites) dialog with the current location and title.
addBookmarkCurrent([win]);
The addClass function adds a CSS class to an element.
addClass(el, className);
The addElementHtml function adds HTML to an element, preserving listeners attached to the existing nodes.
addElementHtml(el, html);
The addElementScript function adds script to a script element.
addElementScript(el, script);
The addElementNodes function adds nodes to an element.
addElementNodes(el, elNewNodes);
The addElementText function adds text to an element.
addElementText(el, text);
The addOption function adds an option to a select element.
addOption(el, text[, value]);
The function returns the new option.
The addOptions function adds one or more options to a select element.
opt = addOption(el, options);
The addScript function adds script to a document.
addScript(text[, docNode]);
The addStyleRule function adds a CSS rule to a document. It is typically used to hide content during the page load, after which the content is enhanced and/or made visible, depending on the available features of the environment.
Note that the canAdjustStyle function should be consulted before hiding content in this way.
addStyleRule(selector, rule[, media[, docNode]]);
The adjacentElement function positions an element adjacent to another.
adjacentElement(el, elAdjacent[, side]);
The attachContextClickListener function adds a listener to an element for two events (contextmenu and mouseup), calling the specified function once per click of the context button.
attachContextClickListener(el, fn[, context]);
The attachDocumentListener function adds an event listener to a document.
attachDocumentListener(ev, fn[, context[, docNode]]);
The attachDocumentReadyListener function adds a DOMContentLoaded listener to a document and a load listener to the document's window, calling the specified function once when the document is ready for programmatic manipulation. The load event is used as a fallback for browsers that do not support the DOMContentLoaded event (e.g. Internet Explorer, Safari.) As the load event is not fired until all document assets (e.g. images, Flash movies) are fully loaded, it is usually preferable to call the documentReady function from a script at the end of the body element. The Document Ready add-on serves this purpose.
Note that some features of the library are not available until the document is ready (e.g. DirectX.) Code that utilizes these features should be wrapped in a function that is passed to attachDocumentReadyListener.
attachDocumentReadyListener(fn[, docNode]);
The attachHelpListener function adds a listener to an element for two events (help and keydown), calling the specified function once per press of the help key.
attachHelpListener(el, fn[, context]);
The attachListener function adds an event listener to an element.
attachListener(el, ev, fn[, context]);
The attachMousewheelListener function adds a listener for two events (mousewheel and dommousescroll), calling the specified function once per mousewheel movement. In addition to passing the standard event parameter, a second argument indicates the direction and distance of the movement.
attachMousewheelListener(el, fn[, context]);
The attachRolloverListeners function adds listeners to an element for two events (mouseover and mouseout), calling each of the two passed functions as appropriate. Optionally, it adds the listeners for the focus and blur events. Another option allows for the automatic display of the element's title in the status bar (requires Status Bar module.)
attachRolloverListeners(el, fnOver, fnOut[, context[, bAddFocusListeners[, bSetStatus]]]);
The attachWindowListener function adds an event listener to a window.
attachWindowListener(ev, fn[, context[, win]]);
The canAdjustStyle function tests if the specified style (display, position or visibility) can be changed programmatically.
b = canAdjustStyle(style);
The function returns a boolean.
The cancelDefault function prevents the default action of an event.
cancelDefault(e);
The cancelPropagation function prevents the bubbling of an event.
cancelPropagation(e);
The changeImage function changes the source of an image. The source may be specified by an image location or the handle of a preloaded image. The optional parameters are for use with effects modules (e.g. DirectX), which replace the standard function with one that supports progressively rendered changeovers.
changeImage(el, src[, options[, callback]]);
The clonePreloadedImage function creates an image element from a preloaded image.
el = clonePreloadedImage(handle);
The function returns an image element.
The cookiesEnabled function tests if cookies are enabled.
b = cookiesEnabled();
The function returns a boolean.
The createElement function creates an (X)HTML element.
el = createElement(tag[, docNode]);
The function returns an element.
The createElementWithAttributes function creates an (X)HTML element and sets one or more attributes.
el = createElement(tag, attributes[, docNode]);
The function returns an element.
The createXmlHttpRequest creates an XHR object.
xhr = createXmlHttpRequest();
The function returns an XHR object.
The deleteCookie function deletes a cookie.
deleteCookie(name[, path[, docNode]]);
The deleteCookieCrumb function deletes a portion of a cookie.
deleteCookieCrumb(name, crumb[, docNode]);
The detachListener function removes an event listener from an element.
detachListener(el, ev, fn);
The detachDocumentListener function removes an event listener from a document.
detachDocumentListener(el, ev, fn[, docNode]);
The detachWindowListener function removes an event listener from a window.
detachWindowListener(el, ev, fn[, win]);
The dispatchEvent function fires an event for an element, resulting in the execution of listeners attached to the specified event.
dispatchEvent(el, ev[, evType]);
The documentReady function tests if the document is ready.
b = documentReady();
The function returns a boolean.
The documentReadyListener function is called internally when the document is ready. It is exposed as a method so it can be called by script at the end of the body element, such as the Document Ready add-on.
documentReadyListener();
The every function calls the specified function for each element of the specified array, returning true if every result is true.
b = every(a, fn[, context]);
The function returns a boolean.
The filter function calls the specified function for each element of the specified array, returning a new array of only the elements for which the result was true.
a = filter(a, fn[, context]);
The function returns a new array.
The forEach function calls the specified function for each element of the specified array.
forEach(a, fn[, context]);
The forEachProperty function calls the specified function for each enumerable property of the specified object.
Note that properties inherited from the object's prototype are excluded.
forEachProperty(o, fn[, context]);
The getAnchor function finds an anchor element by name or index.
el = getAnchor(i[, docNode]);
The function returns an anchor element or null if none is found to match the specified name or index.
The getAnchors function finds all anchor elements in a document.
a = getAnchors([docNode]);
The function returns an array or array-like object.
The getAnElement function retrieves the first element in a document (typically the html element.)
el = getAnElement([docNode]);
The function returns an element or null if none is found.
The getAttribute function retrieves the value of the specified attribute of the specified element.
v = getAttribute(el, name);
The function returns a string or null if the specified attribute does not exist.
The getBodyElement function retrieves the body element of a document.
el = getBodyElement([docNode]);
The function returns a body element or null if none is found.
The getChildren function retrieves all child elements of an element or document.
a = getChildren(node);
The function returns an array or array-like object.
The getCookie function retrieves the cookie with the specified name.
c = getCookie(name[, defaultValue[, encoded[, docNode]]]);
The function returns a string or null if a cookie with the specified name does not exist.
The getCookieCrumb function retrieves a portion of a cookie.
s = getCookieCrumb(name, crumb[, defaultValue[, docNode]]);
The function returns a string or null if a cookie with the specified name does not exist.
The getDocumentWindow function retrieves the containing window of a document.
win = getDocumentWindow([docNode]);
The function returns a window.
The getEBI function retrieves an element with the specified ID.
el = getEBI(id[, docNode]);
The function returns an element with the specified ID or null if not found.
The getEBCN function retrieves elements with the specified class name from an element or document.
el = getEBCN(className[, node]);
The function returns an array.
The getEBCS function retrieves elements that match the specified CSS selector from an element or document.
el = getEBCS(selector[, node]);
The function returns an array.
The getEBTN function retrieves elements with the specified tag name from an element or document.
el = getEBTN(tag[, node]);
The function returns an array or array-like object.
The getEBXP function retrieves elements that match the specified XPath expression from an element or document.
el = getEBXP(path[, node]);
The function returns an array.
The getElementDocument function retrieves the containing document of an element.
el = getElementDocument(el);
The function returns a document or null if the element is part of a fragment.
The getElementParentElement function retrieves the parent element of an element.
el = getElementParentElement(el);
The function returns an element or null if the element is has no parent element (e.g. is the child of a document.)
The getElementText function retrieves the text of an element.
s = getElementText(el);
The function returns a string.
The getEnabledPlugin function retrieves the description of an enabled plugin that matches the specified MIME type or title.
s = getEnabledPlugin(mimeType[, title]);
The function returns a string or null if an enabled plugin is not found.
The getEventTarget function retrieves the target element of an event.
el = getEventTarget(e);
The function returns an element.
The getEventTarget function retrieves the related target element of an event.
el = getEventTargetRelated(e);
The function returns an element or null if there is no related target.
The getForm function finds a form element by name or index.
el = getForm(i[, docNode]);
The function returns a form element or null if none is found to match the specified name or index.
The getForms function finds all form elements in a document.
a = getForms([docNode]);
The function returns an array or array-like object.
The getBodyElement function retrieves the head element of a document.
el = getHeadElement([docNode]);
The function returns a head element or null if none is found.
The getHtmlElement function retrieves the html element of a document.
el = getHtmlElement([docNode]);
The function returns an html element or null if none is found.
The getImage function finds an image element by name or index.
el = getImage(i[, docNode]);
The function returns an image element or null if none is found to match the specified name or index.
The getImages function finds all image elements in a document.
a = getImages([docNode]);
The function returns an array or array-like object.
The getKeyboardKey function retrieves the code of the keyboard key related to an event.
n = getKeyboardKey(e);
The function returns a number.
The getLink function finds a link by name or index.
el = getLink(i[, docNode]);
The function returns an anchor element or null if none is found to match the specified name or index.
The getLinks function finds all links in a document.
a = getLinks([docNode]);
The function returns an array or array-like object.
The getMouseButtons function retrieves the state of the mouse buttons during an event.
o = getMouseButtons(e);
The function returns a object with boolean left, middle and right properties.
The getMousePosition function retrieves the position of the mouse, relative to the document, during an event.
Note that this function is not available until the document is ready.
a = getMousePosition(e);
The function returns an array containing the top and left coordinates (in pixels.)
The getMousewheel function retrieves the distance and direction traveled by the mousewheel during an event.
n = getMousewheelDelta(e);
The function returns a number.
The getOptionValue function retrieves the value of the specified option element.
s = getOptionValue(el);
The function returns a string.
The hasAttribute function tests if the specified element has an attribute with the specified name.
b = hasAttribute(el, name);
The function returns a boolean.
The hasClass function tests if the specified element has the specified CSS class.
b = hasClass(el, className);
The function returns a boolean.
The importNode function imports an element node from one document into another.
el = importNode(el[, bImportChildren[, docNode]]);
The function returns the imported element node.
The isOwnProperty function tests if the specified object does not inherit the specified property from its prototype. The property is stipulated to exist. This function is typically used to filter inherited properties within for-in loops.
b = isOwnProperty(o, p);
The function returns a boolean.
The isXmlParseMode function tests if a document was parsed as XML.
b = isXmlParseMode([docNode]);
The function returns a boolean.
The map function calls the specified function for each element of the specified array, returning a new array of the results.
a = map(a, fn[, context]);
The function returns a new array.
The overlayElement function positions an element to overlay another, optionally covering it.
overlayElement(el, elOver[, cover]);
The preloadImage function loads and stores the specified image resource.
handle = preloadImage(src, h, w);
The function returns a numeric handle to reference the stored image.
The removeClass function removes a CSS class from an element.
removeClass(el, className);
The removeOptions function removes all options from a select element.
removeOptions(el);
The Requester function is a constructor that creates an object that simplifies the process of sending Ajax requests.
requester = new Requester([sId[, sGroup]]);
The serializeFormUrlencoded function encodes name/value pairs of a form element according to the specification of the application/x-www-form-urlencoded MIME type.
s = serializeFormUrlencoded(form);
The function returns a string.
The setActiveStyleSheet function activates style sheets with the specified ID for a document. Style sheets with ID's other than the one specified are deactivated. This function is typically used to switch between alternate style sheets.
setActiveStyleSheet(id[, docNode]);
The setAttribute function sets the value of the specified attribute of the specified element.
el = setAttribute(el, name, value);
The function returns an element, which in some cases may be a replacement (e.g. setting the type attribute of an input element in IE.)
The setCookie function sets the cookie with the specified name to the specified value.
setCookie(name, value[, expires[, path[, secure[, docNode]]]]);
The setCookieCrumb function sets a portion of a cookie.
setCookieCrumb(name, crumb, value[,path[, docNode]]);
The setDefaultStatus function sets the default status bar text for a window.
setDefaultStatus(text[, win]);
The setElementHtml function sets the inner HTML of an element. The optional parameters are for use with effects modules (e.g. DirectX), which replace the standard function with one that supports progressive rendering.
el = setElementHtml(el, html[options[, callback]]);
The function returns an element, which in some cases may be a replacement (e.g. select elements in IE.)
The setElementNodes function replaces the nodes of an element. The optional parameters are for use with effects modules (e.g. DirectX), which replace the standard function with one that supports progressive rendering.
setElementNodes(el, elNewNodes[options[, callback]]);
The setElementOuterHtml function sets the outer HTML of an element. The optional parameters are for use with effects modules (e.g. DirectX), which replace the standard function with one that supports progressive rendering.
el = setElementOuterHtml(el, html[options[, callback]]);
The function returns an element, which is always a replacement.
The setElementScript function sets the text of a script element.
setElementScript(el, text);
The setElementText function sets the text of an element.
setElementText(el, text);
The setStatus function sets the status bar text for a window.
setStatus(text[, win]);
The setStyle function sets the style of the specified element.
setStyle(el, style, rule);
The setStyles function sets multiple styles of the specified element.
setStyles(el, rules);
The some function calls the specified function for each element of the specified array, returning true if at least one result is true.
b = some(a, fn[, context]);
The function returns a boolean.
The urlencode function encodes a string according to the specification of the application/x-www-form-urlencoded MIME type.
s = urlencode(text);
The function returns a string.
The D function constructs an object that abstracts a document.
The E function constructs an object that abstracts an element.
The F function constructs an object that abstracts a form element.
The I function constructs an object that abstracts an image element.
The Q function constructs an object that abstracts multiple elements.
The W function constructs an object that abstracts a window.