52,797
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript">
function btnOnclick() {
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
if (!xmlhttp) { alert("创建XMLHTTP对象异常"); }
return false;
xmlhttp.open("POST", "GetDatae.ashx", false);
xmlhttp.onreadystatechange= function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
document.getElementById("Text1").value = xmlhttp.responseText;
}
else { alert("ajax服务器返回错误!"); }
}
}
xmlhttp.send();
}
</script>
<input id="Text1" type="text" />
<input id="Button1" type="button" value="button" onclick="btnOnclick();"/>