Tinymce drop上传图片和移动上传

时间:2018-01-15 09:29:22

标签: javascript jquery tinymce tinymce-4 tinymce-plugins

1.我想删除图片并上传,但我不能这样做。

tinymce.init({
    selector: 'textarea',
    menubar: false,
    plugins: 'image emoticons',
    toolbar: 'image emoticons',
    forced_root_block: '',
    branding: false,
    statusbar: false,
    image_dimensions: false,
    image_description: false,
    paste_data_images: true,
    setup: function (editor) {
        editor.on('change', function () {
            editor.save();
        });
    },
    images_upload_handler: function (blobInfo, success, failure) {
        var formData = new FormData();
        formData.append('file', $('input[type=file]')[0].files[0]);
        formData.append('test_id', id);
        $.ajax({
            url: 'url.php',
            type: "post",
            data: formData,
            dataType: "text",
            processData: false,
            contentType: false,
            success: function (data) {
                success(data);
            },
            error: function (xhr) {
                console.log(blobInfo);
                console.log(xhr.status);
            }
        });
    },
});

2.我想从手机上传图片。点击选择图片按钮后,我没有选择图片窗口。我该怎么办?

非常感谢!

0 个答案:

没有答案