以下是index.Html:<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xHtml1-transitional.dtd">
<html XMLns="http://www.w3.org/1999/xHtml">
<head>
<meta http-equiv="Content-Type" content="text/Html; charset=utf-8" />
<title>PROTOTYPE POST</title>
<script language="Javascript" type="text/Javascript" src="/script/prototype.JS"></script>
</head>
<body>
<script type="text/Javascript">
function postNewContact(){
var form = $(’form’);
var name = $(’act’);
var url = ’test2.ASP’;
var myAjax = new AJax.Request(url,{method:’post’,
parameters: Form.serialize(form),
onComplete:showResponse});
}
function showResponse(originalRequest){
alert(originalRequest.responseText);
}
</script>
<form method="post" id="form" name="form">
<input type="text" name="act">
<input name="pbut" type="button" value="POST" />
</form>
</body>
</Html>
以下是test2.ASP:
<%=request("act")%>
打開index.Html後,在文本框輸入字符,點擊POST按鈕,就可以看到提交後正確返回的效果.