CKEditor初体验

1.Download the ckeditor.zip file from http://ckeditor.com/, decompress to WebRoot, we can delete _samples,  _source folder and some language js file in lang.

2.Use this code in index.jsp

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
request.setCharacterEncoding("utf-8");	
String ckeditorContent = request.getParameter("ckeditor");
%>
<%=ckeditorContent%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<script type="text/javascript" src="ckeditor/ckeditor.js"></script>

		<title>My JSP 'index.jsp' starting page</title>
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	</head>

	<body>
		<form action="index.jsp" method="post">
				<textarea cols="80" id="ckeditor_kama" name="ckeditor"
					rows="10">Hello World!</textarea>
					<script type="text/javascript">
					CKEDITOR.replace('ckeditor_kama',
						{
							//extraPlugins:'uicolor',
							//toolbar:[['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink'],['UIColor']],
							uiColor:'#CCE8CF',
							skin:'kama'
						});
					</script>
				<input type="submit" value="submit" />
		</form>
	</body>
</html>

 

 

你可能感兴趣的:(JavaScript,html,jsp,css)