【问题标题】:Direct uploading returning incorrect src with Image Element使用 Image Element 直接上传返回不正确的 src
【发布时间】:2016-01-25 00:34:48
【问题描述】:

我在 Cloudinary 中使用 JQuery 插件和未签名的图像上传器。我的图像已成功上传,但从 bind 'cloudinarydone' 返回的 HTML 图像元素包含 file:// 前缀,因此给定的 examples 不会加载 $.cloudinary 。图片();正确地反对。我错过了什么吗?

HTML:

   `<form type="multipart/form-data" class="upload_form"></form>
    <div class="preview"></div>`

Javascript:

    $('.cloudinary_fileupload').bind('fileuploadstart', function (e) {
          $('.preview').html('Upload started...');
    }).bind('cloudinarydone', function (e, data) {
        $('.preview').append(
           $.cloudinary.image(data.result.public_id,
            {
                format: 'jpg', width: 150, height: 100,
                crop: 'thumb', gravity: 'face', effect: 'saturation:50'
            })
    );
    return true;
});

Image: chrome console output

【问题讨论】:

  • 您似乎正在使用file:// 协议(没有网络服务器)加载您的页面。从您的http://localhost/重新加载它

标签: jquery cloudinary


【解决方案1】:

感谢凯多,你说得对,它可以直接使用 http:

您似乎正在使用 file:// 协议(没有网络服务器)加载您的页面。从您的 http://localhost/ 重新加载它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-09-16
    • 1970-01-01
    • 2018-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多