【发布时间】:2020-02-22 11:10:27
【问题描述】:
在我的数据库中,我有一个名为 tasks 的表,它有一个名为 file 的列,用于存储文件。现在我希望当用户单击文件时,他会显示一条弹出消息,要求下载或查看文件。
部分尝试这样
<a href="" id="popup">{{ $task->file }}
我为此创建了一条甜蜜警报消息,如下所示
$(document).ready(function () {
$('popup').on('click', 'td.warning input', function () {
Swal.fire({
title: "Wow!",
text: "Message!",
type: "success",
showCancelButton: true,
cancelButtonText: "View",
confirmButtonText: 'Download!',
},
function (isConfirm) {
if (isConfirm) {
swal("Deleted!", "Your imaginary file has been deleted!", "success");
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
});
});
</script
请帮助我实现这一目标
【问题讨论】:
标签: javascript jquery laravel sweetalert2