kindeditor使用

http://kindeditor.net/demo.php 它自己的网站上有例子和使用说明。

<%@ page language="java" contentType="text/html; charset=UTF-8"
    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=UTF-8">
<title>Insert title here</title>
<script charset="utf-8" src="../kindeditor-4.1.10/kindeditor.js"></script>
<script charset="utf-8" src="../kindeditor-4.1.10/lang/zh_CN.js"></script>
<script>
        KindEditor.ready(function(K) {
                window.editor = K.create('#editor_id');
        });
        
        function getEditor(){
            html = editor.html();
            alert(html);
            
//             editor.sync();
//             html = document.getElementById('editor_id').value;
//             alert(html);
        };
</script>
</head>
<body>
    <form>
        <textarea id="editor_id" name="content" style="width:700px;height:300px;">
&lt;strong&gt;HTML内容&lt;/strong&gt;
</textarea>
    <button id="btn" onclick="getEditor()">get</button>
    </form>
</body>
</html>

 

posted @ 2016-03-24 20:04  长不高  阅读(188)  评论(0编辑  收藏  举报