[原]多种 网页文本编辑器 分析 网上代写程序员推荐

文本编辑器应用总结

一. lhgeditor文本编辑器

lhgeditor组件文件结构

1. lhgeditor.js: 组件的核心JS文件

2. lhgeditor.css:组件的样式表文件

3. images:组件所需的图片都在此文件夹中

以上三个文件为组件所必须的三个文件,组件包中其它以“_”开头的文件为示例的演示文件,实际使用中不需要这些文件。当然框架核心文件lhgcore.js是每个组件都必须用到的文件,记得加载组件前先要加载此文件。

lhgeditor组件使用说明:

1. 在调用组件的页面加载lhgcore.jslhgeditor.js两个文件。

2. window.onload函数里加入J.editor.add(编辑器的id).init();

例:

<script type="text/javascript">

window.onload = function()

{

    J.editor.add('elm1').init();

}

</script>

<form action="_postdate.asp" method="post" target="_blank">

<div>

<textarea name="elm1" [原]多种 网页文本编辑器 分析 网上代写程序员推荐" title="[原]多种 网页文本编辑器 分析 网上代写程序员推荐">

 

二. nicEdit文本编辑器

<script type="text/javascript">

bkLib.onDomLoaded(function() {

new nicEditor().panelInstance('area1');

new nicEditor({fullPanel : true}).panelInstance('area2');

new nicEditor({iconsPath : '../nicEditorIcons.gif'}).panelInstance('area3');

new nicEditor({buttonList :['fontSize','bold','italic','underline','strikeThrough','subscript',

' superscript','html','image']}).panelInstance('area4');

new nicEditor({maxHeight : 100}).panelInstance('area5');

});

</script>

//默认模式

//new nicEditor().panelInstance('area1');

<textarea cols="50" [原]多种 网页文本编辑器 分析 网上代写程序员推荐" title="[原]多种 网页文本编辑器 分析 网上代写程序员推荐">

//new nicEditor({iconsPath : '../nicEditorIcons.gif'}).panelInstance('area3');

<textarea cols="50" [原]多种 网页文本编辑器 分析 网上代写程序员推荐" title="[原]多种 网页文本编辑器 分析 网上代写程序员推荐">


Multi Language Examples(多语言)

<script charset="utf-8" src="../kindeditor-min.js"></script>

<script>

var editor;

KindEditor.ready(function(K) {

K('select[name=lang]').change(function() {

if (editor) {

editor.remove();

editor = null;

}

editor = K.create('textarea[name="content"]', {

langType : this.value

});

});

K('select[name=lang]').change();

});

</script>

<form>

<p>

<select name="lang">

<option value="en">English</option>

<option value="zh_CN">简体中文</option>

<option value="zh_TW">繁體中文</option>

<option value="ar">Arabic</option>

</select>

</p>

  <textarea name="content" style="800px;height:200px;"></textarea>

</form>

[原]多种 网页文本编辑器 分析
网上代写程序员推荐


粘贴设置:

<script charset="utf-8" src="../kindeditor-min.js"></script>

<script charset="utf-8" src="../lang/zh_CN.js"></script>

<script>

KindEditor.ready(function(K) {

K.create('#content1', {

pasteType : 0

});

K.create('#content2', {

pasteType : 1

});

K.create('#content3', {

pasteType : 2

});

});

</script>

   禁止粘贴

<textarea  ></textarea>