【发布时间】:2018-03-23 12:06:21
【问题描述】:
我正在尝试在单击编辑按钮时设置 sweetalert 弹出消息。
这里是示例代码:
<td><a href="/control/edituser/{{Values.id}}" onclick='a' class="btn btn-info">Edit</a></td>
脚本:
<script>
$('a').click(function(e){
e.preventDefault();
var link = $(this).attr('href');
swal({
title: "Are you sure?",
text: "By clicking 'OK' you will be redirected to the link.",
type: "warning",
showCancelButton: true
},
function(){
window.location.href = link;
});
});
</script>
【问题讨论】:
-
JASCRIPT!!!!!!
标签: jquery html css sweetalert sweet.js