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

WBOY
发布: 2016-06-23 13:23:40
原创
1166 人浏览过

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

插件:function.html_kindeditor.php

<?phpfunction smarty_function_html_kindeditor(){    $editor1='        <script type="text/javascript">        var editor1;		KindEditor.ready(function(K) {			var editor1 = K.create(\'textarea[name="content1"]\', {				cssPath : \'/wxy/view/plugins/code/prettify.css\',				uploadJson : \'/wxy/view/upload_json.php\',				fileManagerJson : \'/wxy/view/php/file_manager_json.php\',				allowFileManager : true			});			prettyPrint();		});	</script>		<textarea name="content1" style="width:700px;height:200px;" id="content1"></textarea>	       <input type="button" value="提交" id="subContents"/> ';    return $editor1;}
登录后复制


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

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



回复讨论(解决方案)

allowFileManager : true,						afterBlur:function(){ 							this.sync(); 						}
登录后复制
登录后复制

试试...

allowFileManager : true,						afterBlur:function(){ 							this.sync(); 						}
登录后复制
登录后复制

试试...


还真行,问题解决了。哈哈。
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!