当前位置:Gxlcms > PHP教程 > php下使用kindeditor插件,用js始终获取不到内容,。

php下使用kindeditor插件,用js始终获取不到内容,。

时间:2021-07-01 10:21:17 帮助过:6人阅读

是这样的,我把kindeditor封装到了smarty的插件,在另外一个页面中使用<{html_kindeditor}>引入。

插件:function.html_kindeditor.php
  1. <!--?phpfunction smarty_function_html_kindeditor(){ $editor1='
  2. <textarea name="content1" style="width:700px;height:200px;" id="content1"-->
  3. <input type="button" value="提交" id="subContents"> '; return $editor1;}


另外一个需要引入的模板是:a.html
  1. //jquery代码
  2. $("#subContents").click(function(){
  3. alert("字符串长度:"+($("#content1").val()).length+"类型:"+(typeof $("#content1").val()));
  4. });

输入字符串后,长度为0,判断是string



回复讨论(解决方案)

  1. allowFileManager : true,
  2. afterBlur:function(){
  3. this.sync();
  4. }

试试...

  1. allowFileManager : true,
  2. afterBlur:function(){
  3. this.sync();
  4. }

试试...


还真行,问题解决了。哈哈。

人气教程排行