日期:2014-05-16 浏览次数:21152 次
<script type="text/javascript"> function $(id){ return document.getElementById(id); } function createXHR(){ if(typeof XMLHttpRequest != "undefined"){ return new XMLHttpRequest(); }else if(typeof ActiveXObject != "undefined"){ if(typeof arguments.callee.activeXString != "string"){ var versions=["MSXML2.XMLHttp.6.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp"]; for(var i=0,len=versions.length;i<len;i++){ try{ var xhr = new ActiveXObject(versions[i]); arguments.callee.activeXString=versions[i]; return xhr; }catch(e){} } } return new ActiveXObject(arguments.callee.activeXString); }else{ throw new Error("No XHR object available."); } } function getXML(XHR){ if(XHR.readyState==4){ //4代表下载成功 if(XHR.status>=200 && XHR.status<300 || XHR.status==304){ alert(XHR.responseText); }else{ alert(XHR.statusText); } return true; } } function send_post(URL,para){ var xmlHttp; xmlHttp=createXHR(); xmlHttp.open('POST',URL,false); xmlHttp.onreadystatechange=function(){getXML(xmlHttp);}; xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xmlHttp.send(para); } </script> <form action="2.asp" method="post" name="form1" onsubmit="send_post('2.asp','xm=' + encodeURIComponent(document.form1.xm.value));return false"> <input type="input" name="xm" /> <input type="submit" value="Send" /> </form>
<% dim s s=request.form("xm") response.write s & " hello,world!" response.end %>