Namespace CKEDITOR.scriptLoader
Load scripts asynchronously.
Defined in: core/scriptloader.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Load scripts asynchronously.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
CKEDITOR.scriptLoader.load(scriptUrl, callback, scope, noCheck)
Loads an external script checking if it hasn't been already loaded
previously by this function.
|
<static> |
CKEDITOR.scriptLoader.loadCode(code)
Executes a JavaScript code into the current document.
|
Method Detail
<static>
{Boolean}
CKEDITOR.scriptLoader.load(scriptUrl, callback, scope, noCheck)
Since:
3.0
Loads an external script checking if it hasn't been already loaded
previously by this function.
CKEDITOR.scriptLoader.load( '/myscript.js' );
CKEDITOR.scriptLoader.load( '/myscript.js', function( success ) { // Alerts "true" if the script has been properly loaded. // HTTP error 404 should return "false". alert( success ); });
- Parameters:
- {String} scriptUrl
- The URL pointing to the external script to be loaded.
- {Function} callback Optional
- A function to be called when the script is loaded and executed
- {Object} scope Optional
- The scope ("this" reference) to be used for the callback call. Default to CKEDITOR.
- {Boolean} noCheck Optional
- Indicates that the script must be loaded anyway, not checking if it has already loaded.
- Returns:
- {Boolean} A boolean indicating that the script has been loaded. Returns false if it has already been loaded previously.
<static>
{undefined}
CKEDITOR.scriptLoader.loadCode(code)
Since:
3.0
Executes a JavaScript code into the current document.
CKEDITOR.scriptLoader.loadCode( 'var x = 10;' ); alert( x ); // "10"
- Parameters:
- {String} code
- The code to be executed.