Ajax中get提交和post提交的区别

$.post("HandlerLiuYan.ashx", { leixing: leixing, danwei: danwei, liuyan: liuyan, name: name, phone: phone, email: email },
            function (data) {
                //alert(data);
                if (data == "true") {
                    alert("留言成功,我们会尽快给您回复!");
                    $("[name='quxiao']").click();
                }
            });

后台接收:

if (context.Request.Form["leixing"] != null)
        {
            leixing = context.Request.Form["leixing"].ToString();
        }

 

get提交:

$.get("HandlerLiuYan.ashx", { leixing: leixing, danwei: danwei, liuyan: liuyan, name: name, phone: phone, email: email },
            function (data) {
                //alert(data);
                if (data == "true") {
                    alert("留言成功,我们会尽快给您回复!");
                    $("[name='quxiao']").click();
                }
            });

后台提交:

if (context.Request.QueryString["leixing"] != null)
        { 
            leixing = context.Request.QueryString["leixing"].ToString();
        }

 

posted @ 2013-11-05 15:51  岳帅超  阅读(320)  评论(0编辑  收藏  举报