日期:2014-05-16  浏览次数:20374 次

ajax 前台提交后服务端不能解析
前台数据为UName=*&UPWd=*&UCode=*    后台data只有UName=*。不知道问题出在哪求助。下面是代码。


<script src="../../JS/jquery-1.9.0.js" type="text/javascript"></script>
    <script src="../../JS/msgBox.js" type="text/javascript"></script>
    <script type="text/javascript">
        var msgBox = null;
        $(function () {
            msgBox = new MsgBox({ imghref: "/Images/" });

            $("#imgCode").click(function () {
                this.src = "/Admin/Action/ValidCode.ashx?s=" + Math.random();
            });
            $("#btnReg").click(function () {
                if (!validateInput()) return;
                var dataStr = $("#f1").serialize();
                var dd = $("#UName").val();
                alert(dataStr);     
                var xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); 
                xmlhttp.setRequestHeader("If-Modified-Since", "0");
                xmlhttp.onreadystatechange = function () {
                    if (xmlhttp.readyState == 4) 
                    {
                        if (xmlhttp.status == 200) 
                        {
                            alert(xmlhttp.responseText);
                        }
                        else {
                            alert("AJAX服务器返回错误!");
                        }
        &n