复制代码 代码如下: <BR><!-- <BR>function createRequestObject() { <BR>try { <BR>xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); //for IE explorer <BR>usewin = "msxml"; <BR>} <BR>catch(e) { <BR>try { <BR>xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); //for IE <BR>usewin = "microsoft"; <BR>} <BR>catch(e) { <BR>try{ <BR>xmlhttp=new XMLHttpRequest();}catch(e){} //for Mozilla <BR>} <BR>} <BR>if(!xmlhttp&&typeof XMLHttpRequest!="undefined") { //object is null <BR>xmlhttp=new XMLHttpRequest(); <BR>usewin = "undefined"; <BR>} <BR>return xmlhttp; <BR>} <BR>function sendRequest() { <BR>try{ <BR>var url="/xxxxx.xxx?para_1="xxx"¶_2="xxxx"; <BR>xmlhttp.open("GET", url, true); <BR>xmlhttp.setRequestHeader('Content-Type', "text/xml"); //set request type (xml) <BR>xmlhttp.onreadystatechange = handleResponse; //if state changed, function handleResponse called <BR>xmlhttp.send(null); //send request <BR>} <BR>catch(e){ <BR>alert('Request send failed.'); <BR>} <BR>finally{} <BR>} <br><br><BR>function handleResponse() //state changed <BR>{ <BR>try { <BR>if((xmlhttp.readyState == 4)&&(xmlhttp.status == 200)){ //Received success <BR>var response = xmlhttp.responseXML.documentElement; //get response obj <BR>var node_ = response.getElementsByTagName('user'); //example <BR>var s=""; <BR>var grouplist=document.getElementById("guserlist");//example <BR>var objX=null; <br><br>for(var i=0;i<node_.length;i++) { <BR>var s1=node_[i].childNodes[0].childNodes[0].nodeValue; //id --example <BR>var s2=node_[i].childNodes[1].childNodes[0].nodeValue; //name --example <BR>objX=new Option(s2,s2); <BR>grouplist.options[document.scugroupsmodform.guserlist.length]=objX; <BR>} <BR>} <BR>}catch(e){ <BR>alert('Response failed.'); <BR>} <BR>finally{} <BR>} <BR>//--> <BR> 由于环境限制,只能用英文写注释 .... 原谅下...