我试图使用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>
我所得到的只是“重新调整”,之后没有任何东西。我会做什么不正确?
大卫
谢谢,我知道这是一件小事。 – StealthRT 2012-03-02 09:21:23