ajax post 在 CLASSIC asp 中获得价值 [英] ajax post getting value in CLASSIC asp

查看:17
本文介绍了ajax post 在 CLASSIC asp 中获得价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to get the value of the posted textbox using 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>

我得到的只是重新调整",之后什么都没有.我会做错什么?

All i get is "retuned" and nothing after that. What would i be doing incorrect?

大卫

推荐答案

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

Your ajax is using POST, ASP will need to get the value using request.form instead of request.querystring - alternatively, change your ajax to GET.

这篇关于ajax post 在 CLASSIC asp 中获得价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆