我試圖使用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