KindEditor得不到textarea值的解决方法

it2022-05-05  189

  今天在使用kindeditor的时候,竟然获取不到textarea的值,好像以前使用的时候没有遇到这个问题。

  解决方法是在kindeditor调用JS代码中加入:

  afterBlur: function(){this.sync();}

  以前使用kindeditor时候使用的代码:

  afterCreate : function() {

  var self = this;

  K.ctrl(document, 13, function() {

  self.sync();

  K('form[name=article_add]')[0].submit();

  });

  K.ctrl(self.edit.doc, 13, function() {

  self.sync();

  K('form[name=article_add]')[0].submit();

  });

  }

  可以看到调用代码中都出现了:

  this.sync()

  就是这个 sync函数 造成的。那么这个函数的作用是什么?简单的说就是将编辑器的内容设置到原来的 textarea 控件里。(编辑:雷林鹏 来源:网络)

转载于:https://www.cnblogs.com/pengpeng1208/p/9760170.html

相关资源:各显卡算力对照表!

最新回复(0)