zoukankan      html  css  js  c++  java
  • ckeditor的使用与验证

     1、使id=id的textArea变为富文本编辑框

    function inittextarea(id)
     {
      CKEDITOR.replace(id,{
             '600px',
             height:'300px',
             toolbar : [['Source','Save','NewPage','Preview','Templates','Cut','Copy','Paste','PasteText','PasteFromWord', 'SpellChecker','Scayt','Undo','Redo','Find','Replace','SelectAll','RemoveFormat','Form', 'Checkbox', 'Radio'],['TextField','Textarea','Select', 'Button', 'Bold','Italic','Underline','Strike','Subscript','Superscript','NumberedList','BulletedList','Outdent','Indent','Blockquote','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','Link','Unlink'],['Anchor','Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Styles','Format'],['Font','FontSize','TextColor','BGColor']]
         });
     }

    2、ckeditor验证:

      

    var editor=CKEDITOR.replace( 'editor1' )

    或者

    var oEditor2=CKEDITOR.instances[id];

    然后使用如下语句就可以取得编辑器内的值。

    editor.document.getBody().getText(); //取得纯文本

    editor.document.getBody().getHtml(); //取得html文本

  • 相关阅读:
    python二维数组切片
    [转载]MIPS常用指令及实例
    使用vim编程步骤
    数组指针和指针数组
    线程基础
    顶层const和底层const
    递归调用
    输出流
    C++代码规范
    I/O流
  • 原文地址:https://www.cnblogs.com/qiyongliang/p/3922137.html
Copyright © 2011-2022 走看看