jQuery练习

来源:互联网 发布:怎么设计淘宝首页 编辑:程序博客网 时间:2024/05/17 02:29


        $(".delroom").live("click", function () {
            if (confirm("确认要删除该分类?")) {
                var that = this;
                var rid = $(this).attr("ref");
                $.post("cuisineMan.aspx?action=delroom", { rid: rid }, function (r) {
                    if (r == "True") {
                        $(that).parents("tr").remove();
                    } else {
                        VMsg.AlertError("此分类下已经有菜品,禁止删除!");
                    }
                }, "text");
            }
        });