jquery 弹框,确定、取消

function del(id, url) {
    var bool = confirm("确定删除?")
    if (bool) {
        //点击确定后操作
        var Urls = "/sys/" + url + "/Delete"
        $.ajax({
            type: 'post',
            url: Urls,
            data: { "ids": id },
            success: function (msg) {
                if (msg) {
                    alert("删除成功");
                    window.location.reload()
                } else {
                    alert("系统错误");
                    window.location.reload()
                }
            }
        })
    } else {
        alert("用户点击了取消");
    }
}

效果图: 

 

posted @ 2018-05-15 18:02  紫晶城  阅读(1987)  评论(0编辑  收藏  举报