日期:2014-05-16 浏览次数:20780 次
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div id="dv0"></div>
<div id="dv1"></div>
<div id="dv2"></div>
<div id="dv3"></div>
<div id="dv4"></div>
<div>
<script>
var s = new Array();
s[0] = "test2.aspx?name=test1";
s[1] = "test2.aspx?name=test2";
s[2] = "test2.aspx?name=test3";
s[3] = "test2.aspx?name=test4";
s[4] = "test2.aspx?name=test5";
var a = new Array();
a[0] = "xmlhttp1";
a[1] = "xmlhttp2";
a[2] = "xmlhttp3";
a[3] = "xmlhttp4";
a[4] = "xmlhttp5";
function test() {
for (var i = 0; i < 5; i++) {
alert("第" + i + "次");
a[i] = new XMLHttpRequest();
a[i].open("GET", s[i], true);
a[i].send();
a[i].onreadystatechange = function () {
if (a[i].readyState == 4 && a[i].status == 200) {
document.getElementById("dv" + i).innerHTML = a[i].responseText;
}
&