BiScriptLoaderQueue

Used to load multiple js files and once all are loaded they are executed in the order they were added.

This class extends BiEventTarget and therefore all methods and fields available for BiEventTarget are also available for BiScriptLoaderQueue .

Constructor

new BiScriptLoaderQueue ( )

Parameters

No parameters.

Properties

NameTypegetsetDescripton
asyncBooleancheckedcheckedIf this is set to false then the loading will lock the UI thread but the loading and execution will happen and finish when load is called.
loadedBooleancheckedWhether all scripts have been loaded. This does not necessarily mean that the code inside the scripts have been executed.
loadedCountNumbercheckedReturns the number of finished loading scripts. This includeds the inline scripts as well.
scriptCountNumbercheckedReturns the number of added scripts. This includeds the inline scripts as well.

Methods

NameDescription
abortStops the current loading
addAdds an external script file by providing the URI for the file
addInlineAdds inline script code
execScriptExecutes a string containing javascript in the global scope
loadStarts the loading of the scripts. The loading is done asynchronously so this will return immediately. When all scripts are loaded the load event will fire.

Events

NameTypeBubblesDescripton
loadBiEventFires when all the scripts have been loaded and executed
progressBiEventFires every time one of the external scripts have been loaded. This is useful for providing visual feedback.

Static Methods

None.

Static Fields

None.

Remarks

None.

Method Details

abort

Stops the current loading

Syntax

object.abort ( )

Parameters

No arguments.

Return Type

void

add

Adds an external script file by providing the URI for the file

Syntax

object.add ( oUri )

Parameters

NameTypeOptionalDefaultDescripton
oUriBiUriThe location of the script file. If this is a string a new URI is created from that string relative to the ADF path.

Return Type

void

addInline

Adds inline script code

Syntax

object.addInline ( sText )

Parameters

NameTypeOptionalDefaultDescripton
sTextStringThe JavaScript code to add

Return Type

void

execScript

Executes a string containing javascript in the global scope

Syntax

object.execScript ( s )

Parameters

NameTypeOptionalDefaultDescripton
sStringThe javascript code to execute

Return Type

void

load

Starts the loading of the scripts. The loading is done asynchronously so this will return immediately. When all scripts are loaded the load event will fire.

Syntax

object.load ( )

Parameters

No arguments.

Return Type

void