/** 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