Ueditor

今天给大家介绍一款特别好用,兼容性特别好的富文本编译器,Ueditor

1,创建一个web工程,我这里的工程名是MyUeditor

2,在WEBRoot下创建一个文件夹,我这里取名家js,然后把我们下载好的文件,全部复制到js文件夹下(下载地址:http://pan.baidu.com/s/1pLhRYKr)


3,进入到ueditor下的jsp下的lib下把jar添加到我们的工程里


把index.jsp页面修改如下

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%
    pageContext.setAttribute("basePath", request.getContextPath()+"/") ;
%>
<html>
  <head>

    <title>My JSP 'index.jsp' starting page</title>

	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	 <script type="text/javascript" charset="utf-8" src="${basePath }js/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="${basePath }/js/ueditor/ueditor.all.min.js"> </script>

    <style type="text/css">
        div{
            width:100%;
        }
    </style>
      
  </head>
   <script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor');
</script>
  <body>
<div>
    <h1>完整demo</h1>
    <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>
</div>

  </body>
</html>
运行web工程,运行结果如下:


根据我们的需求我们可以制动的屏蔽一些功能,我们只需要来到


index.jsp中的代码是根据,我们下载的editor中的index.html而来的



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值