$(document).ready(function () {
    //用户数据筛选
    $("#userMemorandum_select").change(function () {
        location.href = window.location.pathname + "?userid=" + $(this).val() + "";
    })

    //删除备忘录
    $("a[rel='del']").click(function () {
        if (confirm('确定要删除备忘录吗？')) {
            var $delObject = $(this);
            $.ajax({
                type: "POST",
                url: "Ajax/Memorandum.ashx",
                data: { 'com': 'delmemorandum', 'mid': $delObject.attr("href"), 'username': $delObject.attr("rev") },
                datatype: "json",
                beforeSend: function (data, textStatus) {
                    $delObject.text("...");
                },
                success: function (data, textStatus) {
                    if (data == "1") {
                        $delObject.parent().parent("tr").remove();
                    } else {
                        alert("删除失败!");
                        $(this).text("[删除]");
                    }
                },
                error: function (e) { alert("连接失败,请向Eoyoo官方技术人员反馈!"); }
            })
        }
        return false;
    })

})