ckEditor 可编辑HTML文本编辑器

例子:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="Scripts/ckeditor/ckeditor.js"></script>
</head>
<body>
    <div id="editorSpace" style="width: 750px">
    </div>
    <input id="Button1" type="button" value="button" />
    <div id="dvq">
    </div>
    <script type="text/javascript">
        CKEDITOR.appendTo(editorSpace);
        CKEDITOR.instances.editor1.setData("hongdada");
        CKEDITOR.editorConfig = function (config) {
            config.language = zh-cn;
            config.width = 750;
            config.height = 450;
            //        config.resize_maxHeight = 450;
            //        //改变大小的最大宽度
            //        config.resize_maxWidth = 750;
            //        //改变大小的最小高度
            //        config.resize_minHeight = 450;
            //        //改变大小的最小宽度
            //        config.resize_minWidth = 750;
            config.resize_enabled = false;
        };
        var btn = document.getElementById("Button1");

        btn.onclick = function () {
            var val = CKEDITOR.instances.editor1.getData();
            var dv = document.getElementById("dvq");
            dv.innerHTML = val;
        }
    </script>
    
</body>
</html>

http://blog.sina.com.cn/s/blog_65f8d7780100u3gh.html

http://blog.csdn.net/shenshen123jun/article/details/8996076

http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#getData

下载

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。