我从事模块翻译工作。
我在一个页面上有超过100 textarea。 为了增加负载,我在点击时创建一个实例。 当我通过点击其他地方退出编辑器时,我想更新de textarea并删除实例。
我这样做但它不起作用。
$('textarea').each(function(){ // Ajout de l'instance $(this).click(function () { //$(this).ckeditor(config_editor); editor = CKEDITOR.replace(this,config_editor); console.log(editor); editor.focusout(function(e) { if (e.editor.checkDirty()) console.log(e.editor.getData()); e.editor.destroy(); }); }); });I work on a module translation.
I have more than 100 textarea on one page. To increase the load I create an instance on click. When I quit the editor by clicking elsewhere, I want to update de textarea and remove the instance.
I do that but it doesn't work.
$('textarea').each(function(){ // Ajout de l'instance $(this).click(function () { //$(this).ckeditor(config_editor); editor = CKEDITOR.replace(this,config_editor); console.log(editor); editor.focusout(function(e) { if (e.editor.checkDirty()) console.log(e.editor.getData()); e.editor.destroy(); }); }); });最满意答案
你可以这样试试
$('textarea').click(function () { //$(this).ckeditor(config_editor); console.log(this); editor = CKEDITOR.replace(this,config_editor); console.log(editor); editor.on('blur', function(e){ if (e.editor.checkDirty()) console.log(e.editor.getData()); e.editor.destroy(); }); });用于动态添加textarea
$(document).on('click','textarea',function(){ //above code });I paste the code of Man Programmer :
// Lancement de CKEDITOR $('textarea').click(function () { editor = CKEDITOR.replace(this,config_editor); editor.on('blur', function(e){ e.editor.destroy(); }); });jQuery / Ckeditor - 更新textarea并在焦点外删除实例(jQuery / Ckeditor - Update textarea and remove instance after focus out)我从事模块翻译工作。
我在一个页面上有超过100 textarea。 为了增加负载,我在点击时创建一个实例。 当我通过点击其他地方退出编辑器时,我想更新de textarea并删除实例。
我这样做但它不起作用。
$('textarea').each(function(){ // Ajout de l'instance $(this).click(function () { //$(this).ckeditor(config_editor); editor = CKEDITOR.replace(this,config_editor); console.log(editor); editor.focusout(function(e) { if (e.editor.checkDirty()) console.log(e.editor.getData()); e.editor.destroy(); }); }); });I work on a module translation.
I have more than 100 textarea on one page. To increase the load I create an instance on click. When I quit the editor by clicking elsewhere, I want to update de textarea and remove the instance.
I do that but it doesn't work.
$('textarea').each(function(){ // Ajout de l'instance $(this).click(function () { //$(this).ckeditor(config_editor); editor = CKEDITOR.replace(this,config_editor); console.log(editor); editor.focusout(function(e) { if (e.editor.checkDirty()) console.log(e.editor.getData()); e.editor.destroy(); }); }); });最满意答案
你可以这样试试
$('textarea').click(function () { //$(this).ckeditor(config_editor); console.log(this); editor = CKEDITOR.replace(this,config_editor); console.log(editor); editor.on('blur', function(e){ if (e.editor.checkDirty()) console.log(e.editor.getData()); e.editor.destroy(); }); });用于动态添加textarea
$(document).on('click','textarea',function(){ //above code });I paste the code of Man Programmer :
// Lancement de CKEDITOR $('textarea').click(function () { editor = CKEDITOR.replace(this,config_editor); editor.on('blur', function(e){ e.editor.destroy(); }); });
发布评论