Code Index | File Index

Namespaces

Classes


Namespace CKEDITOR.scriptLoader

Load scripts asynchronously.
Defined in: core/scriptloader.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Load scripts asynchronously.
Method Summary
Method Attributes Method Name and Description
<static>  
CKEDITOR.scriptLoader.load(scriptUrl, callback, scope, noCheck)
Loads one or more external script checking if not already loaded previously by this function.
<static>  
CKEDITOR.scriptLoader.loadCode(code)
Executes a JavaScript code into the current document.
Namespace Detail
CKEDITOR.scriptLoader
Since: 3.0
Load scripts asynchronously.
Method Detail
<static> {Undefined} CKEDITOR.scriptLoader.load(scriptUrl, callback, scope, noCheck)
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} noCheck Optional
Indicates that the script must be loaded anyway, not checking if it has already loaded.

<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.

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