Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ajax post在经典asp中获得价值_Ajax_Jquery_Post_Asp Classic - Fatal编程技术网

ajax post在经典asp中获得价值

ajax post在经典asp中获得价值,ajax,jquery,post,asp-classic,Ajax,Jquery,Post,Asp Classic,我正在尝试使用jquery AJAX获取发布的文本框的值: 这是我的代码: $(document).ready(function(){ $('#submitButton').click(function() { $.ajax({ type: "POST", url: "test.asp", data: $("#form1").serialize(), cache: false,

我正在尝试使用jquery AJAX获取发布的文本框的值:

这是我的代码:

$(document).ready(function(){
$('#submitButton').click(function() {
    $.ajax({
            type: "POST",
            url: "test.asp",
            data:  $("#form1").serialize(),
            cache: false,
            dataType: "html",
            success: function(responseText){
                alert(responseText);
            },
            error: function(resposeText){
                alert(resposeText);
            },
        });

    return false;
});
 });
这是test.asp页面:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
dim vwPW

  vwPW = request.QueryString("vwPW")

  response.write "returned " & vwPW
%>

我的表格是:

<form id="form1" method="post" action="">
          <table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><input name="vwPW" id="vwPW" type="password" class="textBox" maxlength="10"  /></td>
                <td><button class="GreyB" id="submitButton" name="submitButton"><span style="color:#000">Log in</span></button></td>
              </tr>
            </table>
</form>

登录
我得到的只是“重新调谐”,之后什么都没有。我会怎么做


David

您的表单正在发布,因此您无法通过
Request.QueryString
访问发送的变量,而是通过
Request.form
访问。或者,将ajax调用更改为
类型:'get'

您的ajax正在使用
POST
,ASP将需要使用
request.form
而不是
request.querystring
-或者,将您的ajax更改为
get

谢谢,我知道这是个小问题。