|
Title: some trouble about window load remote url (include editor) Post by: zh_CN on April 04, 2014, 01:13:39 AM Code: function openWindow(cate_id,model_id){the html Quote <textarea name="content"></textarea> <input type="hidden" name="parse" value="0"> <link rel="stylesheet" href="/Public/static/kindeditor/default/default.css" /> <script charset="utf-8" src="/Public/static/kindeditor/kindeditor-min.js"></script> <script charset="utf-8" src="/Public/static/kindeditor/zh_CN.js"></script> <script type="text/javascript"> var editor; KindEditor.ready(function(K) { editor = K.create('textarea[name="content"]', { allowFileManager : false, themesPath: K.basePath, width: '100%', height: '500px', resizeType: 1, pasteType : 2, urlType : 'absolute', fileManagerJson : '/admin.php?s=/Article/fileManagerJson.html', //uploadJson : '/admin.php?s=/Article/uploadJson.html' } uploadJson : '/admin.php?s=/Addons/execute/_addons/EditorForAdmin/_controller/Upload/_action/ke_upimg.html' }); }); $(function(){ //传统表单提交同步 $('textarea[name="content"]').closest('form').submit(function(){ editor.sync(); }); //ajax提交之前同步 $('button[type="submit"],#submit,.ajax-post').click(function(){ editor.sync(); }); }) </script> Title: Re: some trouble about window load remote url (include editor) Post by: stworthy on April 04, 2014, 02:05:32 AM Please try to delay a little time before initializing your editor instance.
Code: <script> Title: Re: some trouble about window load remote url (include editor) Post by: zh_CN on April 05, 2014, 12:47:25 AM Please try to delay a little time before initializing your editor instance. Code: <script> Now, the code in KindEditor.ready(function(K) {}) can't run (I sure this),! So i use KindEditor.create('textarea[name="content"]') , Then i't can be loaded, but don't be editing, the editor is readonly. There may be conflicts |