当前位置:首页 > 开发 > Web前端 > 前端 > 正文

CKEditor使用

发表于: 2012-08-24   作者:bozch   来源:转载   浏览:
摘要: 1、common use   include script label: <script type="text/javascript" src="ckeditor/ckeditor.js"></script>   create textarea element with id="edit

1、common use

 

include script label:


<script type="text/javascript" src="ckeditor/ckeditor.js"></script>

 

create textarea element with id="editor":

 

<textarea id="editor" name="editor" rows="5" cols="55"></textarea>

 

append script follow textarea:

<script type="text/javascript">
var instance = CKEDITOR.instances['shortAnswerEditor'];
if (instance) {//消除已经创建的实例
CKEDITOR.remove( instance);
} else{
CKEDITOR.replace( 'shortAnswerEditor' );//创建新实例
}
</script>

2、java ckeditor

add jar into web-inf/lib path:

 

ckeditor-java-core-3.5.3.jar

 

add taglib into jsp page:


<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>

 

add ckeditor tag (for more see api):


<ckeditor:replaceAll basePath="ckeditor/" className="shortAnswer"/>

 

CKEditor使用

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号