Ueditor image Upload

Source: Internet
Author: User

/** Configuration: * 1. Modify the path in the Ueditor.config.js * 2. Add Ueditor.jar and Commons-fileupload-1.2.2.jar to Lib better * 3. If you are integrating for strut2, you need to add a filter Inherit the original filter and filter the imageup.jsp * 4. If the tool class is used alone, it is recommended to use script instead of input * as follows: * <input id= "upload" type= "text" value= "/> <script id=" Myedit or "></script> <span id=" image ">ddd</span> when used alone, without rendering, get editor.   Otherwise there will be a problem in IE. 5. If only rendering is required, call the Render method directly. * Ueditor Single image upload Tool class*/(function($){    varImage ={editor:NULL, Init:function(Editorid,keyid) {var_editor = This. Geteditor (Editorid); _editor.ready (function() {_editor.setdisabled ();                _editor.hide (); _editor.addlistener (' Beforeinsertimage ',function(t, args) {$ ("#" +keyid). Val (args[0].src);            });        }); }, Geteditor:function(Editorid) { This. Editor =Ue.geteditor (Editorid); return  This. Editor; }, Show:function(ID) {var_editor = This. Editor; //Note that this only needs to get the editor, no rendering, if forced rendering, under IE may be incompatible (remember)           //and the code of some friends on the web is different here.$ ("#" +id). Click (function(){                varImage = _editor.getdialog ("Insertimage");                Image.render ();            Image.open ();        }); }, Render:function(Editorid) {var_editor = This. Geteditor (Editorid);        _editor.render ();    }    }; $(function() {Image.init ("Myeditor", "Upload"); Image.show ("Image"); });}) (jQuery);

Page:

<input id= "Upload" type= "text" value= ""/><script id= "Myeditor" ></script><span id= "image" > Upload Images </span>

Ueditor image Upload

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.