gpt4 book ai didi

javascript - UploadCare 不在对话框中加载图像

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:00:19 27 4
gpt4 key购买 nike

我希望在单击 MyButton 后打开 UploadCare 对话框,显示 Twitter Logo ,但它没有。为什么不呢?

$('#MyButton').on('click', function() {
uploadcare.openDialog('https://g.twimg.com/About_logoUsage.png');
return false;
});

最佳答案

您需要将一个file 对象作为参数传递给openDialog 方法。您可以通过调用 uploadcare.fileFrom 来获取文件对象。方法:

// Pre-load an image from arbitrary URL,
// and open Uploadcare file upload dialog
$('#MyButton').on('click', function() {
var file = uploadcare.fileFrom('url', 'https://g.twimg.com/About_logoUsage.png');
uploadcare.openDialog(file);
return false;
});

关于javascript - UploadCare 不在对话框中加载图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27613480/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com