UEditor编辑器引用跟设置(持续更新)

    <!-- 加载编辑器的容器 -->
			    <script id="container" name="content" type="text/plain">
			        {$res.content} 这里输入变量,会出现在编辑框里
			    </script>
    <!-- 配置文件 -->
   	<script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="/ueditor/ueditor.all.js"></script>
    <!-- 实例化编辑器 -->  
    <script type="text/javascript">
        var ue = UE.getEditor('container',{
		  	initialFrameWidth :1000,//设置编辑器宽度
		  	initialFrameHeight:500,//设置编辑器高度		
		  	autoHeightEnabled: false,//是编辑器高度固定
	  	 });
        ue.ready(function(){
		     //设置编辑器的内容
		     ue.setContent('代码点击左上角HTML!');
		     //获取html内容
		     var html = ue.getContent();
		     //获取纯文本内容
		     var txt = ue.getContentTxt();
 		 });
    </script>

猜你喜欢

转载自blog.csdn.net/qq_39383675/article/details/83024905
今日推荐