Code Index | File Index

Namespaces

Classes


Namespace CKEDITOR.scriptLoader


Defined in: core/scriptloader.js.

Method Summary
Method Attributes Method Name and Description
<static>  
CKEDITOR.scriptLoader.load(scriptUrl, callback, scope, showBusy)
Loads one or more external script checking if not already loaded previously by this function.
Method Detail
<static> {Undefined} CKEDITOR.scriptLoader.load(scriptUrl, callback, scope, showBusy)
Since: 3.0
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:
{String|Array} scriptUrl
One or more URLs pointing to the scripts to be loaded.
{Function} callback 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 array parameters are passed to the callback; the first contains the URLs that have been properly loaded, and the second the failed ones.
{Object} scope Optional
The scope ("this" reference) to be used for the callback call. Default to CKEDITOR.
{Boolean} showBusy Optional
Changes the cursor of the document while + * the script is loaded.

Copyright © 2003-2010, CKSource - Frederico Knabben. All rights reserved.