- <div>
- <H1> Full 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="Commit" onclick="t ()"> </input></div>
- Iii. creating an instance of the UE object
- <script type="Text/javascript">
- Instantiation Editor
- We recommend that you use the factory method Geteditor to create and reference the editor instance, and if you refer to the editor under a closure, call Ue.geteditor (' editor ') directly to get the relevant instance
- 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 '//define the action name of the upload
- });
- UE. Editor.prototype._bkgetactionurl = UE. EDITOR.PROTOTYPE.GETACTIONURL;
- UE. EDITOR.PROTOTYPE.GETACTIONURL = Function (action) {
- if (action = = ' Testupload ') {//Jump to later upload 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 Editor, custom image upload