Description

API for managing DOM and JavaScript memory leaks.

File

WEB-CORE\scripts\sapphirecore.js

Properties

Property Type Description
bin Object Array Contents of the bin.
limit Integer Maximum number of items in the bin before emptying (defaults to 10).
size Integer Number of items in the bin.

add

 

Functionality

Adds an element/object to the garbage bin. After the bin has reached the maximum number of items, this empties the bin using the collect method (below). Adding an element to the bin removes the element from its parent (using removeChild).

Parameters

Parameter Type Description
vElement Variant Can be an identifier of an element, an object reference to an element, or an array of elements.

Returns

None.

collect

 

Functionality

Empties the bin, thus freeing any memory occupied by the elements/objects inside of the bin.

Parameters

None.

Returns

None.