将百度编辑器中的图片独立出来上传:
html:代码
<input type="button" value="上传图片" style="width:70px;cursor:pointer;" id="uploadid" onclick="upImage()"/>
<script type="text/javascript"> var myEditorImage,d,myEditorImage = new UE.ui.Editor(); myEditorImage.render('uploadid'); myEditorImage.ready(function(){ myEditorImage.setDisabled(); myEditorImage.hide();//隐藏UE框体 myEditorImage.addListener('beforeInsertImage',function(t, arg){ $("#picid").attr("value", arg[0].src); }); myEditorImage.addListener('afterUpfile',function(t, arg){ $("#picid").attr("value", arg[0].src); }); }); function upImage(){ d = myEditorImage.getDialog("insertimage"); d.render(); d.open(); } </script>