tinymce.dom.ScriptLoader

Namespace tinymce.dom
Class ScriptLoader
This class handles asynchronous/synchronous loading of JavaScript files it will execute callbacks when various items gets loaded. This class is useful to load external JavaScript files.

Example

Public Methods

Method Defined By
add(url:String, callback:function, scope:Object):void
Adds a specific script to the load queue of the script loader.
ScriptLoader
isDone(url:String):Object
Returns true/false if a script has been loaded or not.
ScriptLoader
load(url:String, callback:function, scope:Object):void
Loads a specific script directly without adding it to the load queue.
ScriptLoader
loadQueue(callback:function, scope:Object):void
Starts the loading of the queue.
ScriptLoader
loadScripts(scripts:Array, callback:function, scope:Object):void
Loads the specified queue of files and executes the callback ones they are loaded.
ScriptLoader
markDone(u:string):void
Marks a specific script to be loaded.
ScriptLoader

Method details

addmethod

public function add(url:String, callback:function, scope:Object):void
Adds a specific script to the load queue of the script loader.

Parameters

url:String Absolute URL to script to add.
callback:function Optional callback function to execute ones this script gets loaded.
scope:Object Optional scope to execute callback in.

isDonemethod

public function isDone(url:String):Object
Returns true/false if a script has been loaded or not.

Parameters

url:String URL to check for.

Returns

Object - [Boolean} true/false if the URL is loaded.

loadmethod

public function load(url:String, callback:function, scope:Object):void
Loads a specific script directly without adding it to the load queue.

Parameters

url:String Absolute URL to script to add.
callback:function Optional callback function to execute ones this script gets loaded.
scope:Object Optional scope to execute callback in.

loadQueuemethod

public function loadQueue(callback:function, scope:Object):void
Starts the loading of the queue.

Parameters

callback:function Optional callback to execute when all queued items are loaded.
scope:Object Optional scope to execute the callback in.

loadScriptsmethod

public function loadScripts(scripts:Array, callback:function, scope:Object):void
Loads the specified queue of files and executes the callback ones they are loaded. This method is generally not used outside this class but it might be useful in some scenarios.

Parameters

scripts:Array Array of queue items to load.
callback:function Optional callback to execute ones all items are loaded.
scope:Object Optional scope to execute callback in.

markDonemethod

public function markDone(u:string):void
Marks a specific script to be loaded. This can be useful if a script got loaded outside the script loader or to skip it from loading some script.

Parameters

u:string Absolute URL to the script to mark as loaded.