甜蜜提示突然关闭

时间:2019-12-13 10:04:59

标签: javascript html jsp

我正在尝试在jsp中删除甜蜜警报,但是在即时消息单击后,突然关闭了该甜蜜警报。 为什么会这样?

这是我的甜蜜提醒代码:

function deleteAlert() {
    swal({
        title: 'Are you sure?',
        text: "You won't be able to revert this!",
        type: 'warning',
        timer: 5000,
        showCancelButton: true,
        confirmButtonColor: '#3085d6',
        cancelButtonColor: '#d33',
        confirmButtonText: 'Yes, delete it!'
    }).then((result) => {
        if (result.value) {
            swal(
                'Deleted!',
                'Your file has been deleted.',
                'success'
            )
        }
    })
}

这是我的jsp代码:

<a href="regionServlet?action=delete&id=<%=region.getRegionId()%> " 
   data-toggle="tooltip" data-placement="top" 
   title="Delete"><i class="fas fa-trash fa-lg"style="color:#f03434;"onclick="deleteAlert()"></i>
</a>

0 个答案:

没有答案