juery ajax语法
                $.ajax({
                    url: "/ForgetCard/ForgetLogin",//方法路径URL
                    data: {
                        strUser: $("#textUser").val(),                   //申请人
                        strForgetDate: $("#txtForgetDate").val(),        //忘记打卡日
                        strLoginDate: $("#txtLoginDate").val(),          //登录日
                        strType: $("#drpType").val(),                    //类型
                        strForgetType: $("#drpForgetCard").val(),        //忘记打卡类型
                        strBeiko: $("#txtBeiko").val(),                  //备注
                        strWitness: $("#drpWiness").val()                  //证明人
                    },//参数
                    dataType: 'json',
                    type: 'POST',
                    async: false,//默认异步调用 false:同步
                    success: function (data) {
                        var retInfo = eval(data);
                        //提交成功
                        if (retInfo == true) {
                            alert("提交成功!");
                            $("#txtForgetDate").val("");        //忘记打卡日
                            $("#txtLoginDate").val("");         //登录日
                            $("#drpType").val("0");                  //类型
                            $("#txtBeiko").val("");                  //备注
                            $(".ForgetCard").css("visibility", "hidden");
                            window.parent.location.reload;
                        }
                    },
                    error: function () {
                        alert('提交数据失败!');
                    }
                })




        $.ajax({
            url: "/HolidayManage/SelectData",
            data: {
                strbmID: function () { return strBmId },           //申请人所在部门CD  
                strUser: function () { return strUser },          //申请人
                strBEGIN_TIME: function () { return strBEGIN_TIME },            //请假起始时间
                strEND_TIME: function () { return strEND_TIME }         //请假结束时间
            },
            dataType: 'json',
            type: 'POST',
            async: false,
            success: function (data) {
                $("#tblView tbody").html("");
                var strTrsContent = "";
                var strTrsContent = "";
                $.each(eval(data), function (n, value) {
                    strTrsContent = "";
                    strTrsContent += "<tr>";
                    //请假单号
                    strTrsContent += "<td  style='width:125px;'>" + value.HOLIDAY_CD + "</td>";
                    //姓名
                    strTrsContent += "<td  style='width:95px;'>" + value.STAFF_NAME + "</td>";
                    //所属部门
                    strTrsContent += "<td style='width:168px;' >" + value.DEP_Name + "</td>";
                    //请假类别
                    strTrsContent += "<td style='width:205px;' >" + value.O_TYPE + "</td>";
                    //开始时间
                    strTrsContent += "<td style='width:180px;' >" + value.O_BEGIN_TIME + "</td>";
                    //结束时间
                    strTrsContent += "<td style='width:180px;' >" + value.O_END_TIME + "</td>";
                    //审批状态
                    strTrsContent += "<td style='width:180px;' >" + value.O_APPROVE_STATE + "</td>";


                    if (value.O_APPROVE_STATE == "待审批") {
                        //操作
                        strTrsContent += "<td style='width:250px'><input type='button' name='" + value.HOLIDAY_CD + "'  id='btnSP'  class='btn' value='审核' ><input type='button' name='" + value.HOLIDAY_CD + "'  class='btn' id='btnDel' value='删除'/></td>";
                    } else {
                        strTrsContent += "<td style='width:250px'><input type='button' name='" + value.HOLIDAY_CD + "'  id='btnSP'  style='display:none'  class='btn' value='审核' ><input type='button' name='" + value.HOLIDAY_CD + "'  style='display:none'  id='btnDel' value='删除'/></td>";
                       
                    }
                    $("#tblView tbody").append(strTrsContent);

                });
            },
            error: function () {
                alert('提交数据失败!');
            }
        });

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/angle860123/article/details/7402396
想对作者说点什么? 我来说一句

Ajax基本语法 Ajax

2010年01月11日 55KB 下载

没有更多推荐了,返回首页

不良信息举报

juery ajax语法

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭