jquery on 确认删除

$(document).on('click', '.delbtn', function() {
        if (confirm("确定要删除吗?")) {
            var adminid=$(this).attr("class").split("d")[0].trim();
            $.ajax({
                url : "/adm/deladmin.shtml",
                data : {
                    'adminid':adminid
                },
                type : "POST",
                success : function(result) {
                    if(result){
                        $("#"+adminid).hide();
                    }
                },
                error : function(request) {
                    alert("sorry!");
                }
            }, "json");
        }

 

posted @ 2017-03-29 16:49  次序  阅读(2617)  评论(0编辑  收藏  举报