Core API

Getting Started

Getting started is easy. Simply include AccDC like so:

<script type="text/javascript" src="Acc.DC.API.js">
// Initialize AccDC
</script>

Core

Important:
  1. When declaring AccDC Objects, the "id" and "role" properties are required to be set for every object.
    ("id" must be unique, "role" does not) E.G.
    // Shell of an AccDC Object declaration
    {
    id: 'myObj',
    role: 'Test Object',
    ...
    }
  2. Any registered AccDC Object can be accessed through the "$A.reg" object using its "id". E.G.
    var dc = $A.reg.myObj;
    // or
    var dc = $A.reg['myObj'];
  3. The "dc" object, when returned as an argument to AccDC Object methods, is synonymous with "this", and refers to the current AccDC Object instance.
  4. Tip: To see where dynamic insertion is used to insert AccDC Objects into the DOM, or which screen reader accessible hidden text is being rendered, disable CSS in your browser.
    This will show you the hierarchy of rendered elements, and is useful when testing localization for hidden content.
$A()

The "$A()" function registers an array of AccDC Object declarations.

$A.morph()

The "$A.morph()" method converts any DOM node into an AccDC Object at runtime.

$A.destroy()

The "$A.destroy()" method destroys an AccDC Object and removes it from memory.

.id

The "id" property is the object reference for all registered AccDC Objects.

.trigger

The "trigger" property is a CSS Selector or DOM node that assigns triggering element(s) for an AccDC Object.

.bind

The "bind" property assigns one or more event binders to the triggering element.

.mode

The "mode" property specifies the fetch method for pulling content into an AccDC Object.

.source (Mode0-5 Property)

The "source" property is a string or DOM node that specifies either literal content or a resource locator specifying where content will be pulled into an AccDC Object.

$A.query()

"$A.query()" is a shorthand method for returning an array of DOM nodes using a CSS Selector, or executing a callback on each returned object.