ueditor 1.2.6使用方法
本文以php版本为例:
文件下载:http://ueditor.baidu.com/website/download.html
还可以自己先定义内容,然后下载,这样可以帮助我们精简不少东西。
以本地php环境为例,现在www目录下建立一个app目录作为测试目录,然后将下载的ueditor文件夹解压到app文件夹下。
然后,在app文件夹下建立一个index.php文件。
然后输入以下代码:
<!DOCTYPE html>
<html>
<head>
<title>编辑器完整版实例</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="./ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="./ueditor/ueditor.all.js"></script>
<link rel="stylesheet" href="./ueditor/themes/default/css/ueditor.css"/>
</head>
<body>
<h2>UEditor提交示例</h2>
<form id="form" method="post" target="_blank">
<script type="text/plain" id="myEditor" name="myEditor">
<p>欢迎使用UEditor!</p>
</script>
<input type="submit" value="通过input的submit提交">
</form>
<p>
从1.2.6开始,会自动同步数据无需再手动调用sync方法
<button onclick="document.getElementById('form').submit()">通过js调用submit提交</button> </p> <script type="text/javascript">
var editor_a = UE.getEditor('myEditor',{initialFrameHeight:500}); //--自动切换提交地址----
var doc=document,
version=editor_a.options.imageUrl||"php",
form=doc.getElementById("form");
form.action="./getContent.php";
</script> </body> </html>
然后再浏览器输入localhost/app/
就可以查看编辑器了;
然后会发现图片上传功能无法使用,需要打开ueditor.config.js
然后找到这一行代码:
var URL = window.UEDITOR_HOME_URL || (function(){
然后再这一行代码的上面加上这行代码:
window.UEDITOR_HOME_URL||"/app/ueditor/";
然后,刷新一下页面,图片上传功能就可以使用了。
ueditor的官方说明文档地址:http://ueditor.baidu.com/website/document.html
官方说明文档中的文件名有错误(应该是版本升级之后没有修改过来),请大家注意。
ueditor 1.2.6使用方法的更多相关文章
- Ueditor百度编辑器中 setContent()方法的使用
百度编辑器Ueditor所提供的setContent()方法作用是:设置或者改变编辑器里面的文字内容或html内容 函数说明:setContent(string,boolean); 参数string ...
- UEditor无法复制的解决方法
今天终于知道UEditor不能复制的真正原因啦,还是自己一直没有仔细研究. UEditor 粘贴 Excell 中的表格时报错导致无法粘贴的解决办法 在UEditor一些版本中,如果粘贴Excell中 ...
- ueditor百度编辑器的赋值方法
示例: http://ueditor.baidu.com/website/onlinedemo.html 引用代码: window.UMEDITOR_HOME_URL = $CONFIG['domai ...
- ueditor使用代码高亮的方法
最近发现ueditor支持代码高亮,但是页面上并没有起效果,于是网上找了下,发现还需做如下修改: 1.页面引用以下资源文件(均位于ueditor目录中): <script type=" ...
- 百度编辑器Ueditor增加字体的修改方法
http://www.jb51.net/article/109896.htm Ueditor本身自带11种字体 使用过程中这11种字体往往不能满足我们的需求,现在我要添加"仿宋" ...
- ueditor富文本编辑的使用方法
平时在编写上传文件,图片,视频等等这些功能的代码会很繁琐,这里我介绍一款由百度推出的CuteEditor,是一款功能非常强大,支持图片上传.文件下载和word类似的文字编辑器.对于新闻发布系统和博客之 ...
- Ueditor百度编辑器中的 setContent()方法的使用
百度编辑器Ueditor所提供的setContent()方法作用是:设置或者改变编辑器里面的文字内容或html内容 函数说明:setContent(string,boolean); 参数string ...
- thinkphp和ueditor自定义后台处理方法整合
先了解一下ueditor后台请求参数与返回参数格式规范: 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 ...
- Ueditor 1.4.3.1 使用 ThinkPHP 3.2.3 的上传类进行图片上传
在 ThinkPHP 3.2.3 中集成百度编辑器最新版 Ueditor 1.4.3.1,同时将编辑器自带的上传类替换成 ThinkPHP 3.2.3 中的上传类. ① 下载编辑器(下载地址:http ...
随机推荐
- ural 2022 Riding a Toad
2022. Riding a Toad Time limit: 1.0 secondMemory limit: 64 MB A tribe of leafmen live in the old for ...
- Android开发中dp、dpi、px的区别(转)
一.基本概念 - dp:安卓中的相对大小 - dpi:(dot per inch)每英寸像素多少 - px:像素点 二.详细说明 1.px和dpi - px: 平常所说的1920×1080只是像素数量 ...
- linux 部署python2.7
tar xvf Python-.tar.bz2 mkdir /usr/local/python27 ls cd Python- ./configure --prefix=/usr/local/pyth ...
- mysql查询哪张表数据最大
转载:https://blog.csdn.net/qq13650793239/article/details/81142134 mysql数据库中information_schema 数据库存储了数据 ...
- MySQL 约束和数据库设计
1.MySQL 约束: 1.约束的概念: 约束是一种限制,它通过对表的行或列的数据做出限制,来确保表的数据的完整性.唯一性. MySQL中,常用的几种约束: 约束类型: 非空 主键 唯一 外键 默认值 ...
- LeetCode OJ:Binary Tree Paths(二叉树路径)
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 ...
- ZOJ2112 Dynamic Rankings (线段树套平衡树)(主席树)
The Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with t ...
- NAT路由器打洞原理
什么是打洞,为什么要打洞 由于Internet的快速发展 IPV4地址不够用,不能每个主机分到一个公网IP 所以使用NAT地址转换. 下面是我在网上找到的一副图 一般来说都是由私网内主机(例如上图中“ ...
- 基于微服务的父maven依赖
<dependencies> <!-- spring-boot核心 --> <dependency> <groupId>org.springframew ...
- 锁存器 Latch v.s. 触发器 Flip-Flop
转载 http://guqian110.github.io/pages/2014/09/23/latch_versus_flip_flop.html 根据 Wiki: Flip-flop (elec ...