tinymce.full.js
function loadScript(url, success, failure) {
        var dom = DOM, elm, id;

        // Execute callback when script is loaded
        function done() {
          dom.remove(id);

          if (elm) {
            elm.onreadystatechange = elm.onload = elm = null;
          }

          success();
        }

        function error() {
          /*eslint no-console:0 */

          // We can't mark it as done if there is a load error since
          // A) We don't want to produce 404 errors on the server and
          // B) the onerror event won't fire on all browsers.
          // done();

          if (isFunction(failure)) {
            failure();
          } else {
            // Report the error so it's easier for people to spot loading errors
            if (typeof console !== "undefined" && console.log) {
              console.log("Failed to load script: " + url);
            }
          }
        }

        id = dom.uniqueId();

        // Create new script element
        elm = document.createElement('script');
        elm.id = id;
        elm.type = 'text/javascript';
        elm.src = Tools._addCacheSuffix(url);

        // Seems that onreadystatechange works better on IE 10 onload seems to fire incorrectly
        if ("onreadystatechange" in elm) {
          elm.onreadystatechange = function () {
            if (/loaded|complete/.test(elm.readyState)) {
              done();
            }
          };
        } else {
          elm.onload = done;
        }

        // Add onerror event will get fired on some browsers but not all of them
        elm.onerror = error;

        // Add script to document
        (document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
      }
function loadScript(url, success, failure) {
        var dom = DOM, elm, id;

        // Execute callback when script is loaded
        function done() {
          dom.remove(id);

          if (elm) {
            elm.onreadystatechange = elm.onload = elm = null;
          }

          success();
        }

        function error() {
          /*eslint no-console:0 */

          // We can't mark it as done if there is a load error since
          // A) We don't want to produce 404 errors on the server and
          // B) the onerror event won't fire on all browsers.
          // done();

          if (isFunction(failure)) {
            failure();
          } else {
            // Report the error so it's easier for people to spot loading errors
            if (typeof console !== "undefined" && console.log) {
              console.log("Failed to load script: " + url);
            }
          }
        }

        id = dom.uniqueId();

        // Create new script element
        elm = document.createElement('script');
        elm.id = id;
        elm.type = 'text/javascript';
        elm.src = Tools._addCacheSuffix(url);

        // Seems that onreadystatechange works better on IE 10 onload seems to fire incorrectly
        if ("onreadystatechange" in elm) {
          elm.onreadystatechange = function () {
            if (/loaded|complete/.test(elm.readyState)) {
              done();
            }
          };
        } else {
          elm.onload = done;
        }

        // Add onerror event will get fired on some browsers but not all of them
        elm.onerror = error;

        // Add script to document
        (document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
      }
function loadScript ( url , success , failure ) { var dom = DOM , elm , id ; // Execute callback when script is loaded function done ( ) { dom . remove ( id ) ; if ( elm ) { elm . onreadystatechange = elm . onload = elm = null ; } success ( ) ; } function error ( ) { /*eslint no-console:0 */ // We can't mark it as done if there is a load error since // A) We don't want to produce 404 errors on the server and // B) the onerror event won't fire on all browsers. // done(); if ( isFunction ( failure ) ) { failure ( ) ; } else { // Report the error so it's easier for people to spot loading errors if ( typeof console !== "undefined" && console . log ) { console . log ( "Failed to load script: " + url ) ; } } } id = dom . uniqueId ( ) ; // Create new script element elm = document . createElement ( 'script' ) ; elm . id = id ; elm . type = 'text/javascript' ; elm . src = Tools . _addCacheSuffix ( url ) ; // Seems that onreadystatechange works better on IE 10 onload seems to fire incorrectly if ( "onreadystatechange" in elm ) { elm . onreadystatechange = function ( ) { if ( / loaded|complete / . test ( elm . readyState ) ) { done ( ) ; } } ; } else { elm . onload = done ; } // Add onerror event will get fired on some browsers but not all of them elm . onerror = error ; // Add script to document ( document . getElementsByTagName ( 'head' ) [ 0 ] || document . body ) . appendChild ( elm ) ; }
Loads a specific script directly without adding it to the load queue.

@method load
@param {String} url Absolute URL to script to add.
@param {function} callback Optional success callback function when the script loaded successfully.
@param {function} callback Optional failure callback function when the script failed to load.
Loads a specific script directly without adding it to the load queue .