- <div>
- <h1>完整demo</h1>
- <form method="post" name="form">
- <div id="editor" name="content" style="width:800px;height:500px"></div>
- <div id="editor2" name="content" style="width:800px;height:500px"></div>
- </form>
- </div>
- <div><input type="button" value="提交" onclick="t()"></input></div>
- 三、创建ue对象实例
- <script type="text/javascript">
- //实例化编辑器
- //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
- var ue = UE.getEditor('editor',{
- toolbars: [
- ['source','subscript','superscript', 'undo', 'redo', 'bold', 'snapscreen','preview', 'simpleupload','insertimage', 'emotion',
- 'spechars', 'drafts' , 'time','date']
- ],
- autoHeightEnabled: true,
- autoFloatEnabled: true,
- imageActionName:'testUpload'//定义上传的action名称
- });
- UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
- UE.Editor.prototype.getActionUrl = function(action) {
- if (action == 'testUpload') {//跳转到后来的上传action
- return '${pageContext.request.contextPath}/testEditor/testUpload.action';
- } else {
- return this._bkGetActionUrl.call(this, action);
- }
- }
- function t(){
- form.action="${pageContext.request.contextPath }/testEditor/testForm.action";
- form.submit();
- }
- </script>
ueditor 编辑器,自定义图片上传
猜你喜欢
转载自www.cnblogs.com/zhao-shan/p/9052223.html
今日推荐
周排行