日期:2014-05-17 浏览次数:20546 次
<script type="text/javascript">
var request = createXMR();
function createXMR() {
var xmr;
if (window.XMLHttpRequest) {
xmr = new XMLHttpRequest();
}
else {
xmr = new ActiveXObject("Microsoft.XMLHTTP");
}
return xmr;
}
function send() {
document.getElementById("d1").innerHTML = "数据加载中...";
request.open("get", "01.ashx", true);
request.onreadystatechange = function () {
if (request.readyState == 4 && request.states == 200) {
var data = request.responseText;
document.getElementById("d1").innerHTML = data;
}
else {
document.getElementById("d1").innerHTML = "服务器内部错误";
}
}
request.send();
}
</script>
<input type="button" value="get" onclick="send()" />
<div id="d1">
</div>