fckeditor常用用法
来源:互联网 发布:eia油库存最新数据 编辑:程序博客网 时间:2024/05/21 19:33
经常使用 fckeditor 做编辑器,每次用到的时候总是找以前的代码例子。
所以就想整理总结一些常用的例子:
一, JS 调用
1. 先把脚本文件包含进来
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
2. 可以添加一个检测函数,这里比较奇怪,用 document.getElementById("content ").value 是抓取不到值的。要两次才能抓取到值,所以编辑器值的检测另外写了一个函数
<script type="text/javascript">
function submit(){
if(oEditer.GetXHTML(true) ==""){
alert(" 警告信息! ");
return false;
}
return true;
}
var oEditer;
function FCKeditor_OnComplete( editorInstance )
{
oEditer = editorInstance;
}
</script>
3. 在 form 标签里加上 submit 方法
<form action="" method="post" onSubmit="return adminSubmit()">
4. 在要用到编辑器的 textarea 标签下加上脚本,如 textarea 标签名为 content ,则 new FCKeditor("content ") 。
<textarea id="content " name="content "><{$content}></textarea>
<script type="text/javascript">
var oFCKeditor = new FCKeditor("content ") ;
oFCKeditor.BasePath = "fckeditor/";
oFCKeditor.ToolbarSet = "Shop";
oFCKeditor.Width = "400";
oFCKeditor.ReplaceTextarea();
</script>
今天先到这里了,下次继续,还有 php 代码中插入编辑器的方法,也很常用到。
- fckeditor常用用法
- FCKEditor用法
- FCKEditor用法
- FCKEditor用法
- FCKEditor用法
- FCKeditor的用法
- FCKEditor常用设置
- FCKEditor常用设置
- FCKeditor常用配置
- fckeditor常用配置
- fckeditor的用法(转)
- FCKeditor在java里的用法
- FCKeditor 的简单用法(.NET2.0中)
- FCKeditor在asp.net中的用法
- FCKeditor在asp.net中的用法
- FCKeditor文本编辑器的优势以及用法
- FCKeditor在asp.net中的用法
- asp.net中应用FCKEditor用法归总
- 错误:
- Flex中如何监测摄像头Camera对象活动以及状态事件与信息
- const的用法
- Flex中如何利用Camera.names和Camera.getCamera(),获取摄像头名称数组
- the movie
- fckeditor常用用法
- Flex中通过borderStyle和dropShadowEnabled样式,给VBox容器设置阴影
- Flex中如何通过verticalScrollPolicy属性,控制VBox容器内容超过容器大小时滚动条自动显示与否
- 辞职
- Flex中如何通过verticalGap样式,设置VBox的各项间间距
- Flex中如何通过direction属性,改变Box容器(HBox或VBox)方向
- Flex中如何利用backgroundImage和backgroundAttachment样式,设置VBox背景图片
- Flex中如何通过backgroundImage, backgroundColor和backgroundAlpha样式,设置VBox的背景图片和背景颜色以及改变透明度
- Muchacha linda!iFeliz Cumpleanos!