阿贾克斯后获得的价值在传统的ASP [英] ajax post getting value in CLASSIC asp

查看:164
本文介绍了阿贾克斯后获得的价值在传统的ASP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用jQuery AJAX来获取张贴文本框的值:

I am trying to get the value of the posted textbox using jquery AJAX:

这是我的code:

$(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 - 或者,改变你的阿贾克斯 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.

这篇关于阿贾克斯后获得的价值在传统的ASP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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