标签:edit page meta base class 编辑框 head color 工具
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script type="text/javascript" src="res/js/jquery.js"></script> <script type="text/javascript" src="res/fckeditor/fckeditor.js"></script> <script type="text/javascript"> $(function(){ var fck=new FCKeditor("myTextArea"); fck.BasePath="res/fckeditor/"; fck.ReplaceTextarea(); }) </script> </head> <body> <textarea rows="" cols="" id="myTextArea"></textarea> </body> </html>
以上是最基础的引入,同时可以自定义编辑框的工具栏,在fckconfig.js中复制
FCKConfig.ToolbarSets["Default"] = [ [‘Source‘,‘DocProps‘,‘-‘,‘Save‘,‘NewPage‘,‘Preview‘,‘-‘,‘Templates‘], [‘Cut‘,‘Copy‘,‘Paste‘,‘PasteText‘,‘PasteWord‘,‘-‘,‘Print‘,‘SpellCheck‘], [‘Undo‘,‘Redo‘,‘-‘,‘Find‘,‘Replace‘,‘-‘,‘SelectAll‘,‘RemoveFormat‘], [‘Form‘,‘Checkbox‘,‘Radio‘,‘TextField‘,‘Textarea‘,‘Select‘,‘Button‘,‘ImageButton‘,‘HiddenField‘], ‘/‘, [‘Bold‘,‘Italic‘,‘Underline‘,‘StrikeThrough‘,‘-‘,‘Subscript‘,‘Superscript‘], [‘OrderedList‘,‘UnorderedList‘,‘-‘,‘Outdent‘,‘Indent‘,‘Blockquote‘,‘CreateDiv‘], [‘JustifyLeft‘,‘JustifyCenter‘,‘JustifyRight‘,‘JustifyFull‘], [‘Link‘,‘Unlink‘,‘Anchor‘], [‘Image‘,‘Flash‘,‘Table‘,‘Rule‘,‘Smiley‘,‘SpecialChar‘,‘PageBreak‘], ‘/‘, [‘Style‘,‘FontFormat‘,‘FontName‘,‘FontSize‘], [‘TextColor‘,‘BGColor‘], [‘FitWindow‘,‘ShowBlocks‘,‘-‘,‘About‘] // No comma for the last row. ] ;
更改为
FCKConfig.ToolbarSets["myToolBar"] = [ [‘Source‘,‘DocProps‘,‘-‘,‘Save‘,‘NewPage‘,‘Preview‘,‘-‘,‘Templates‘], [‘Cut‘,‘Copy‘,‘Paste‘,‘PasteText‘,‘PasteWord‘,‘-‘,‘Print‘,‘SpellCheck‘], [‘Undo‘,‘Redo‘,‘-‘,‘Find‘,‘Replace‘,‘-‘,‘SelectAll‘,‘RemoveFormat‘], [‘Form‘,‘Checkbox‘,‘Radio‘,‘TextField‘,‘Textarea‘,‘Select‘,‘Button‘,‘ImageButton‘,‘HiddenField‘] ] ;
之后在jsp中添加
$(function(){ var fck=new FCKeditor("myTextArea"); fck.BasePath="res/fckeditor/"; fck.ToolbarSet="myToolBar";//自定义工具栏 fck.ReplaceTextarea(); })
标签:edit page meta base class 编辑框 head color 工具
原文地址:http://www.cnblogs.com/lm970585581/p/7450763.html