Ticket #4767: 4767_5.patch

File 4767_5.patch, 1.6 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Revised patch

  • _source/core/loader.js

     
    161161
    162162                                // We must guarantee the execution order of the scripts, so we
    163163                                // need to load them one by one. (#4145)
    164                                 // The followin if/else block has been taken from the scriptloader core code.
    165                                 if ( CKEDITOR.env.ie )
     164                                // The following if/else block has been taken from the scriptloader core code.
     165                                if ( typeof(script.onreadystatechange) !== "undefined" )
    166166                                {
    167167                                        /** @ignore */
    168168                                        script.onreadystatechange = function()
     
    190190
    191191                        /**
    192192                         * Loads a specific script, including its dependencies. This is not a
    193                          * synchronous loading, which means that the code the be loaded will
     193                         * synchronous loading, which means that the code to be loaded will
    194194                         * not necessarily be available after this call.
    195195                         * @example
    196196                         * CKEDITOR.loader.load( 'core/dom/element' );
     
    217217                                var scriptSrc = getUrl( '_source/' + scriptName + '.js' );
    218218
    219219                                // Append the <script> element to the DOM.
    220                                 if ( document.body )
     220                                // If the page is fully loaded, we can't use document.write
     221                                // but if the script is run while the body is loading then it's safe to use it
     222                                // Unfortunately, Firefox <3.6 doesn't support document.readyState, so it won't get this improvement
     223                                if ( document.body && (!document.readyState || document.readyState == 'complete') )
    221224                                {
    222225                                        pendingLoad.push( scriptName );
    223226
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy