Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何在追加脚本后触发加载_Jquery_Ckeditor - Fatal编程技术网

Jquery 如何在追加脚本后触发加载

Jquery 如何在追加脚本后触发加载,jquery,ckeditor,Jquery,Ckeditor,我正在使用CKEditor,这个编辑器在variable-editor.document.$上创建了一个新的DOM树。我已将JS脚本附加到editor.document.$.head,但我不明白如何触发它们实际加载: CKEDITOR.on( 'instanceReady', function( ev ) { editor = ev.editor; if(editor.name == 'edit-body-und-0-value'){ var head = editor

我正在使用CKEditor,这个编辑器在variable-editor.document.$上创建了一个新的DOM树。我已将JS脚本附加到editor.document.$.head,但我不明白如何触发它们实际加载:

CKEDITOR.on( 'instanceReady', function( ev ) {
    editor = ev.editor;
    if(editor.name == 'edit-body-und-0-value'){
     var head = editor.document.getHead();
     var body = editor.document.getBody();

     var s0 = editor.document.$.createElement( 'script' );
     s0.type = 'text/javascript';
     s0.onload = function() {
         console.log( 'script path/jquery-1.11.0.min.js loaded' );
     };
     s0.src = '/path/jquery-1.11.0.min.js';
     s0.$ = s0;
     head.append(s0);

     var s2 = editor.document.$.createElement( 'script' );
     s2.type = 'text/javascript';
     s2.onload = function() {
         console.log( 'script path/jquery-ui/jquery-ui-1.10.3.custom.min.js loaded' );
     };
     s2.src = '/path/jquery-ui/jquery-ui-1.10.3.custom.min.js';
     s2.$ = s2;
     head.append(s2);

     jQuery(editor.document.$).ready(function($) {
         $ = jQuery(editor.document.$);
         $.trigger("load");
         Some.init();
         Layout.init();
         ...
      });
    }
});
我可以看到附加到头部的脚本,但是没有加载任何脚本。他们晚了点才上船,但为时已晚。我希望在调用init之前加载它们。怎么做?多谢各位