CKEditor 4 Documentation

CKEDITOR.scriptLoader

Files

Load scripts asynchronously.

Defined By

Methods

CKEDITOR.scriptLoader
view source
( scriptUrl, [callback], [scope], [showBusy] )
Loads one or more external script checking if not already loaded previously by this function. ...

Loads one or more external script checking if not 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 );
} );

CKEDITOR.scriptLoader.load( [ '/myscript1.js', '/myscript2.js' ], function( completed, failed ) {
    alert( 'Number of scripts loaded: ' + completed.length );
    alert( 'Number of failures: ' + failed.length );
} );

Parameters

  • scriptUrl : String/Array

    One or more URLs pointing to the scripts to be loaded.

  • callback : Function (optional)

    A function to be called when the script is loaded and executed. If a string is passed to scriptUrl, a boolean parameter is passed to the callback, indicating the success of the load. If an array is passed instead, two arrays parameters are passed to the callback - the first contains the URLs that have been properly loaded and the second the failed ones.

  • scope : Object (optional)

    The scope (this reference) to be used for the callback call. Defaults to CKEDITOR.

  • showBusy : Boolean (optional)

    Changes the cursor of the document while the script is loaded.

CKEDITOR.scriptLoader
view source
( scriptUrl, [callback] )
Loads a script in a queue, so only one is loaded at the same time. ...

Loads a script in a queue, so only one is loaded at the same time.

Available since: 4.1.2

Parameters

  • scriptUrl : String

    URL pointing to the script to be loaded.

  • callback : Function (optional)

    A function to be called when the script is loaded and executed. A boolean parameter is passed to the callback, indicating the success of the load.

    CKEDITOR.scriptLoader.load