1.引入
1
2.三个常用的提示框
$(".demo_1").click(function() {
swal("这是一个信息提示框!");
});
$(".demo_2").click(function() {
swal(“Good!”, “弹出了一个操作成功的提示框”, “success”);
});
$(".demo_3").click(function() {
swal(“OMG!”, “弹出了一个错误提示框”, “error”);
});
3.警告框提示
swal({
title: "您确定要删除吗?",
text: "您确定要删除这条数据?",
type: "warning",
showCancelButton: true,
closeOnConfirm: false,
confirmButtonText: "是的,我要删除",
confirmButtonColor: "#ec6c62"
}, function() {
$.post(getUrl("Cart/del"), {id: id}, function(data) {
location.reload();
})
});