首页 > 代码库 > 百度编辑器:上传图片

百度编辑器:上传图片

<!DOCTYPE html>
<html>
<head>
    <title>we234234</title>
    <script src=http://www.mamicode.com/"ueditor.config.js"></script>
    <script src=http://www.mamicode.com/"ueditor.all.js"></script>
    <script src=http://www.mamicode.com/"lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<div id="editor" style="display: none;"></div>
<button type="button" onClick="upImage()">上传</button>
</body>
<script>
    /*kindeditor 编辑器*/
    var ue = UE.getEditor(editor);

    //监听图片上传
    ue.addListener(beforeInsertImage, function (t,arg)
    {
        alert(这是图片地址:+arg[0].src);
    });

    //弹出图片上传的对话框
    function upImage()
    {
        var myImage = ue.getDialog("insertimage");
        myImage.open();
    }

</script>

</html>

 

百度编辑器:上传图片