文字编辑器kindeditor-min.js的使用

例子:

 1 <link rel="stylesheet" type="text/css" href="<?=$WebSiteRootDir?>/webcontrol/webcontrol_warnled/extlib/default/default.css">
 2 <script type="text/javascript"  src="<?=$WebSiteRootDir?>/webcontrol/webcontrol_warnled/extlib/kindeditor-min.js"></script>
 3 <script type="text/javascript"  src="<?=$WebSiteRootDir?>/webcontrol/webcontrol_warnled/extlib/zh_CN.js"></script>
 4         <script>
 5             var editor;
 6             KindEditor.ready(function(K) {
 7                 editor = K.create('textarea[name="node_desc"]', {
 8                     resizeType : 0,
 9                     allowPreviewEmoticons : false,
10                     allowImageUpload : false,
11                     minWidth:'500px',
12                     minHeight:'50px',
13                     items : [
14                         'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
15                         'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
16                         'insertunorderedlist']
17                 });
18             });
19         </script>
20 
21 
22     <?
23                 
24 echo "<tr><td>告警灯描述</td><td>";
25 
26                  
27 echo "<textarea name='node_desc' type='text' size='40' style=\"width:400px;height:30px;visibility:hidden;\">".$webcontrol_param_list['node_desc']."</textarea>";
28 echo "</td></tr>";
29                 
30                 
31                 ?>

使用kindeditor-min.js 要与html的<textarea>挂钩,而不能与<input name type='text' size='40' style=\"width:400px;height:30px;visibility:hidden; value= ">这种方式。

posted @ 2015-04-13 17:00  cogitoergosum  阅读(1015)  评论(0编辑  收藏  举报