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
| Name | Type | get | set | Descripton |
async | Boolean | ![]() | ![]() | If 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. |
loaded | Boolean | ![]() | Whether all scripts have been loaded. This does not necessarily mean that the code inside the scripts have been executed. | |
loadedCount | Number | ![]() | Returns the number of finished loading scripts. This includeds the inline scripts as well. | |
scriptCount | Number | ![]() | Returns the number of added scripts. This includeds the inline scripts as well. |
Methods
| Name | Description |
abort | Stops the current loading |
add | Adds an external script file by providing the URI for the file |
addInline | Adds inline script code |
execScript | Executes a string containing javascript in the global scope |
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. |
Events
| Name | Type | Bubbles | Descripton |
load | | Fires when all the scripts have been loaded and executed | |
progress | | Fires 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
| Name | Type | Optional | Default | Descripton |
oUri | | The 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
| Name | Type | Optional | Default | Descripton |
sText | String | The JavaScript code to add |
Return Type
void
execScript
Executes a string containing javascript in the global scope
Syntax
object.execScript ( s ) Parameters
| Name | Type | Optional | Default | Descripton |
s | String | The 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
