toastr.warning('已有数据,请勿重复添加!');
toastr.error('已有数据,请勿重复添加!');
toastr.success('提交数据成功');
toastr.info('info');
sweetalert提示框:
所用到的css以及js
<link href="~/Styles/sweetalert.css" rel="stylesheet" />
<script src="~/Scripts/sweetalert.min.js"></script>
代码展示
1 show({
2 title: "操作提示", //弹出框的title
3 text: "确定删除吗?", //弹出框里面的提示文本
4 type: "warning", //弹出框类型
5 showCancelButton: true, //是否显示取消按钮
6 confirmButtonColor: "#DD6B55",//确定按钮颜色
7 cancelButtonText: "取消",//取消按钮文本
8 confirmButtonText: "是的,确定删除!",//确定按钮上面的文档
9 closeOnConfirm: true
10 }, function () {
11 $.ajax({
12 type: "post",
13 url: "/Home/Delete",
14 data: { "": JSON.stringify(arrselections) },
15 success: function (data, status) {
16 if (status == "success") {
17 toastr.success('提交数据成功');
18 $("#tb_departments").bootstrapTable('refresh');
19 }
20 },
21 error: function () {
22 toastr.error('Error');
23 },
24 complete: function () {
25
26 }
27
28 });
29 });
有不懂的可以可以查看sweetalert网站
sweetalert Api:http://t4t5.github.io/sweetalert/