<script type="text/javascript"> function btnClick() { var xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); if(!xmlHttp) { alert("创建XMLHTTP对象出错"); return false; } xmlHttp.open("Post","AjaxHandler.ashx?ts"+new date(),false); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4){ if(xmlHttp.status==200){ document.getElementById("Text1").value=xmlHttp.responseText; } else { alert("AJAX返回值错误"); } } } xmlHttp.send(); } </script>