1 var xmlHttp; 2 var iii = 0; 3 if (window.XMLHttpRequest) { 4 xmlHttp = new XMLHttpRequest(); 5 if (xmlHttp.overrideMimeType) 6 xmlHttp.overrideMimeType('text/xml'); 7 } else if (window.ActiveXObject) { 8 try { 9 xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); 10 } catch (e) { 11 try { 12 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 13 } catch (e) { 14 } 15 } 16 } 17 var callback = function(e) { 18 if(e.currentTarget.status == 200){ dohttp(iii)} 19 } 20 var url = ["http://*****" 21 ,"http://*****" 22 ,"http://*****" 23 ,"http://*****" 24 ,"http://*****" 25 ,"http://*****" 26 ,"http://*****" 27 ] 28 var dohttp = function(i) { 29 iii = i+1; 30 xmlHttp.open("GET", url[i], true);// 异步处理返回 31 xmlHttp.setRequestHeader("Authorization","bearer 0d6b6c89-3c07-4b8a-9be3-04788191e464") 32 xmlHttp.onreadystatechange = callback; 33 xmlHttp.setRequestHeader("Content-Type", 34 "application/x-www-form-urlencoded;"); 35 xmlHttp.send() 36 } 37 dohttp(0); 38