設置 | 登錄 | 註冊

目前共有1篇帖子。

ajax还是出错了

1樓 巨大八爪鱼 2010-10-19 12:34

<!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=gb2312" />
<title>无标题文档</title>
<script type="text/javascript" src="../../Scripts/Base.js"></script>
<script src="../../Scripts/prototype.js"></script>
<script>
function s(){
 var val=t(form1.textfield.value);
 var myAjax=new Ajax.Request('back.php',{method:'post',parameters:'s='+val,onComplete:d});
}
function d(q){
 alert(q.responseText);
}
function t(s){
 return encodeURI(encodeURI(s));
}
</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <label>
  <input name="textfield" type="text" id="textfield" value="3炯就囧氺++8·27&as00115=772" size="50" />
  </label>
  <label>
  <input type="button" name="button" id="button" value="发送请求" onclick="s()" />
  </label>
</form>
</body>
</html>

內容轉換:

回覆帖子
內容:
用戶名: 您目前是匿名發表。
驗證碼:
看不清?換一張
©2010-2025 Purasbar Ver3.0 [手機版] [桌面版]
除非另有聲明,本站採用知識共享署名-相同方式共享 3.0 Unported許可協議進行許可。