JQ.jquery-confirm | 功能强大的jQuery对话框和确认取消框插件

<link href="/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/css/jquery-confirm.css" rel="stylesheet" />
    <script src="/JS/jquery-confirm.js"></script>

上面三个文件地址:

https://download.csdn.net/download/wybshyy/12517854

 

function Del(key) {
            $.confirm({
                title: '提示',
                content: '确定要删除吗?',
                confirm: function () {
                    var url = "/YuanGongPingJia/Templates_SubjectsList.aspx?act=SubjectsDel";
                    $.ajax({
                        type: "post",
                        url: url,
                        dataType: "json",
                        data: { key: key },
                        success: function (r) {
                            try {
                                if (r.code > 0) {
                                    layer.msg('操作成功', { icon: 6 });
                                    GetSubjectsList("");
                                }
                                else {
                                    layer.msg(r.ErrorMsg, { icon: 5 });
                                    layer.close(loadIndex);
                                }
                            } catch (e) {
                                layer.close(loadIndex);
                            }
                        }, complete: function (r) {
                            layer.close(loadIndex);
                        }
                    });
                },
                cancel: function () {
                    $.alert('操作取消!');
                }
            });

            
        }

 

 

 

posted @ 2020-06-12 15:42  离。  阅读(93)  评论(0编辑  收藏