审计记录

WebContent/WEB-INF/jsp/pc/testue.jsp 2.3 KB
zxt@theyeasy.com committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
<%@ 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>富文本测试</title>
<style type="text/css">
#connect-container {
	float: left;
	width: 400px
}

#connect-container div {
	padding: 5px;
}

#console-container {
	float: left;
	margin-left: 15px;
	width: 400px;
}

#console {
	border: 1px solid #CCCCCC;
	border-right-color: #999999;
	border-bottom-color: #999999;
	height: 170px;
	overflow-y: scroll;
	padding: 5px;
	width: 100%;
}

#console p {
	padding: 0;
	margin: 0;
}
</style>

<script src="http://cdn.sockjs.org/sockjs-0.3.min.js"></script>

<script type="text/javascript">
	 
</script>
</head>
<body>

	 <!-- 加载编辑器的容器 -->
    <script id="container" name="content" type="text/plain">
                                       这里写你的初始化内容
    </script>
    <!-- 配置文件 -->
    <script type="text/javascript" src="/zzhnc/res/UE/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="/zzhnc/res/UE/ueditor.all.js"></script>
    <!-- 实例化编辑器 -->
    <script type="text/javascript">
    
    UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
    UE.Editor.prototype.getActionUrl = function(action) {
        if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') {
            return '/zzhnc/upload/NewUploadImg';
        } else {
            return this._bkGetActionUrl.call(this, action);
        }
    }
      //  var ue = UE.getEditor('container');
         //实例化加入参数
        var ue = UE.getEditor('container', {
            autoHeight: false
        });
        var ue = UE.getContent();
         //对编辑器的操作最好在编辑器ready之后再做
        ue.ready(function() {
          //设置编辑器的内容
          ue.setContent('hello');
          //获取html内容,返回: <p>hello</p>
          var html = ue.getContent();
          console.log("html:"+html);
          //获取纯文本内容,返回: hello
          var txt = ue.getContentTxt();
          console.log("text:"+txt);
      });
    </script>
</body>
</html>