-
▼$A.getEl()
-
The "$A.getEl()" method returns an element with a matching ID attribute.
-
Syntax
var myEl = $A.getEl('objId');
-
▼$A.createEl()
-
The "$A.createEl()" method returns a newly created element.
-
Syntax
// Format: $A.createEl(tagName, attributeKey/ValueMap, cssKey/ValueMap, className, domNodeToInsert)
var myLink = $A.createEl('a', {
href: 'url',
target: '_blank'
}, {
fontSize: '1.1em',
backgroundColor: '#f5f5f5'
}, 'link external', document.createTextNode('Visit here to learn more about stuff!'));
// Or for a basic element
var basicElement = $A.createEl('div');
-
▼$A.getAttr()
-
The "$A.getAttr()" method returns the value of an attribute on a DOM node.
-
Syntax
var myTitle = $A.getAttr(domNode, 'title');
-
▼$A.remAttr()
-
The "$A.remAttr()" method removes an attribute, or an array of attributes from a DOM node.
-
Syntax
$A.remAttr(domNode, 'title');
// Or
$A.remAttr(domNode, [
'title',
'id'
]);
-
▼$A.setAttr()
-
The "$A.setAttr()" method sets an attribute, or a series of attributes on a DOM node.
-
Syntax
$A.setAttr(domNode, 'title', 'The chocolate moose is not in season');
// Or
$A.setAttr(domNode, {
title: 'The chocolate moose is not in season',
id: 'myObjId'
});
-
▼$A.getText()
-
The "$A.getText()" method returns the textual content of any DOM node.
-
Syntax
var text = $A.getText(domNode);
-
▼$A.inArray()
-
The "$A.inArray()" method returns the index value of a matching item within an array or string.
-
Syntax
var pos = $A.inArray('My name is Bryan', 'Bryan');
// Or
var pos = $A.inArray([
'Bryan',
'Joe'
], 'Bryan');
// Then
if (pos === -1) alert('Not Found');
else alert('Found');
-
▼$A.fn.globalDC
-
The "$A.fn.globalDC" object is merged with every AccDC Object, simulating a prototype where plugins and extensions can be globally added to each instance.
-
Default: {}
Syntax
// Change the default functionality for all AccDC Objects by adding an override
$A.fn.globalDC.returnFocus = false;
// Or add a custom method/property to every AccDC Object
$A.fn.globalDC.myFunction = function(){
var dc = this; // The current AccDC Object instance
alert(dc.id);
return dc; // To preserve method chaining
};
Important
-
Changes to the "$A.fn.globalDC" object will not automatically be applied to previously instantiated AccDC Objects.
-
Use the "$A.globalDCMerge()" method to manually merge "$A.fn.globalDC" with all previously instantiated AccDC Objects.
-
▼$A.globalDCMerge()
-
The "$A.globalDCMerge()" method manually merges the "$A.fn.globalDC" object with all previously instantiated AccDC Objects.
-
Syntax
$A.globalDCMerge();
-
▼$A
-
"$A" is the global namespace for the AccDC API, which includes internal namespaces that should not be overwritten.
-
Reserved namespaces:
-
$A.reg
-
$A.fn
The "$A" global namespace can be manually reassigned to prevent conflicts.
// Syntax
// In the head tag...
<script type="text/javascript">
// Set a new global namespace
AccDCNamespace = "Whatever";
</script>
<script type="text/javascript" src="Acc.DC.API.js">
// Then load the AccDC API
// Now "Whatever" is the global namespace
</script>
-
▼dc
-
"dc" refers to the current instance of any registered AccDC Object, which includes internal namespaces that should not be overwritten.
-
Reserved namespaces:
-
dc.ajaxOptions
-
dc.drag
-
dc.drop
-
dc.accDD
-
dc.shadow
-
dc.fn