我希望在单击 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/