網頁

2014年12月17日 星期三

使用CKEditor建立HTML編輯器

1.到Ckeditor下載套件,盡量下載Full Package版本,避免導致某項功能不能打開。



2.在JSP加入textarea tag。
<textarea id="testid" name="testid"></textarea>
3.Script中加入 ckeditor函數。
    CKEDITOR.replace('testid', {
        language:'zh',
        width:'760px',
        height:'300px',
        toolbar :[
            ['Cut','Copy','Paste','PasteText','PasteFromWord','-',
            'NumberedList','BulletedList','Outdent','Indent','-',
            'Undo','Redo','-',
            'Bold','Italic','Underline','Strike','-',
            'JustifyLeft','JustifyCenter','JustifyRight','-',
            'FontSize','TextColor','BGColor','-','CreateDiv',
            'Image','Table','HorizontalRule']
        ]//'Preview',,'SpecialChar','Source'
    });


沒有留言:

張貼留言