设为首页 加入收藏

TOP

ueditor的用法
2017-10-13 10:35:04 】 浏览:6903
Tags:ueditor 用法

今天做了一下百度富文本编辑器,遇到了一些问题,现在来总结一下:

(1)jQuery没有引用,解决方法:引用jQuery并且放在所有的js前面

(2)没有报错,但是样式显示不出来。解决方法:css引用的路径不对,注意有时候按住Ctrl+鼠标左键可以跳到css里面,但是还是显示不了样式,说明还是css的路径不对,至于为什么,我现在也没想明白。

(3)解决了以上问题,就可以实现效果了

 

(4)以下是实现的代码,以及项目目录,记录以下以便以后再出现相同的问题

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
     
    <link href="css/um_default/css/umeditor.css" rel="stylesheet" type="text/css" />
    <link href="css/um_default/css/umeditor.css" rel="stylesheet" type="text/css" />
    
    <script type="text/java script" src="/js/jquery-2.0.3.min.js"></script>
    <script type="text/java script" src="/js/umeditor/umeditor.config.js"></script>
    <script type="text/java script" src="/js/umeditor/umeditor.min.js"></script>
    <script type="text/java script" src="/js/umeditor/lang/zh-cn/zh-cn.js"></script> 
  </head>
  
  <body>
   <script type="text/plain" id="myEditor" style="margin-left: 15px;min-width:620px;min-height:250px;">
   </script>
  </body>
  <script type="text/java script">
  var um1 = UM.getEditor('myEditor', {
                autoHeight : true,
                initialFrameWidth : 620
            });
  </script>
</html>

 

 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇可变对象与不可变对象 下一篇JAVAEE——SSH项目实战04:联系人..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目