<select name="seldw" id="seldw" onchange="getData()">
部门列表
</select>
<SCRIPT LANGUAGE="JavaScript">
<!--
function getData()
{
document.all.password.value = "";
var dwid = document.all.seldw.value;
var submitURL="queryPerson.jsp?dwid="+dwid;
postXmlHttp( submitURL, 'parseData()' ,'load()');
}
function parseData()
{
clearList();
var obj= document.getElementById("myspan");
obj.innerHTML = _xmlHttpRequestObj.responseText;
var returnValue = obj.innerHTML;
obj.innerHTML = ""; var username = document.getElementById("username");
var option = null; var val = returnValue.split(",");
if(val!=""){
for(var i = 0 ; i < val.length-1 ; i++){
var val1 = val[i].split("-");
option = document.createElement("option");
option.setAttribute("value",val1[0]);
option.appendChild(document.createTextNode(val1[1]));
username.appendChild(option);
}
} //var loadDiv= document.getElementById( "load" );
//loadDiv.style.display="none";
}function clearList(){
var username = document.getElementById("username");
while(username.childNodes.length>0){
username.removeChild(username.childNodes[0]);
}
var option = null;
option = document.createElement("option");
option.setAttribute("value","");
option.appendChild(document.createTextNode("--请选择--"));
username.appendChild(option);
}
function load()
{
//var loadDiv= document.getElementById( "load" );
// loadDiv.style.display="block";
}
//-->
</SCRIPT>包含的一个js文件
var _postXmlHttpProcessPostChangeCallBack;
var _xmlHttpRequestObj;
var _loadingFunction;
function postXmlHttp( submitUrl, callbackFunc ,loadFunc)
{
_postXmlHttpProcessPostChangeCallBack = callbackFunc;
_loadingFunction = loadFunc;
if(window.createRequest)
{
try{
_xmlHttpRequestObj=window.createRequest();
_xmlHttpRequestObj.open('POST',submitUrl,true);
_xmlHttpRequestObj.onreadystatechange=postXmlHttpProcessPostChange;
_xmlHttpRequestObj.send();
}
catch(ee){}
}
else if(window.XMLHttpRequest)
{
_xmlHttpRequestObj=new XMLHttpRequest();
_xmlHttpRequestObj.overrideMimeType('text/xml');
_xmlHttpRequestObj.open('POST',submitUrl,true);
_xmlHttpRequestObj.onreadystatechange=postXmlHttpProcessPostChange;
_xmlHttpRequestObj.send("");
}
else if(window.ActiveXObject)
{
_xmlHttpRequestObj=new ActiveXObject("Microsoft.XMLHTTP");
_xmlHttpRequestObj.open('POST',submitUrl,true);
_xmlHttpRequestObj.onreadystatechange=postXmlHttpProcessPostChange;
_xmlHttpRequestObj.send();
}
};function postXmlHttpProcessPostChange(){
if( _xmlHttpRequestObj.readyState==4 && _xmlHttpRequestObj.status==200 ){
setTimeout( _postXmlHttpProcessPostChangeCallBack, 200 );
}
if ( _xmlHttpRequestObj.readyState==1){
setTimeout( _loadingFunction, 2 );
}
}
部门列表
</select>
<SCRIPT LANGUAGE="JavaScript">
<!--
function getData()
{
document.all.password.value = "";
var dwid = document.all.seldw.value;
var submitURL="queryPerson.jsp?dwid="+dwid;
postXmlHttp( submitURL, 'parseData()' ,'load()');
}
function parseData()
{
clearList();
var obj= document.getElementById("myspan");
obj.innerHTML = _xmlHttpRequestObj.responseText;
var returnValue = obj.innerHTML;
obj.innerHTML = ""; var username = document.getElementById("username");
var option = null; var val = returnValue.split(",");
if(val!=""){
for(var i = 0 ; i < val.length-1 ; i++){
var val1 = val[i].split("-");
option = document.createElement("option");
option.setAttribute("value",val1[0]);
option.appendChild(document.createTextNode(val1[1]));
username.appendChild(option);
}
} //var loadDiv= document.getElementById( "load" );
//loadDiv.style.display="none";
}function clearList(){
var username = document.getElementById("username");
while(username.childNodes.length>0){
username.removeChild(username.childNodes[0]);
}
var option = null;
option = document.createElement("option");
option.setAttribute("value","");
option.appendChild(document.createTextNode("--请选择--"));
username.appendChild(option);
}
function load()
{
//var loadDiv= document.getElementById( "load" );
// loadDiv.style.display="block";
}
//-->
</SCRIPT>包含的一个js文件
var _postXmlHttpProcessPostChangeCallBack;
var _xmlHttpRequestObj;
var _loadingFunction;
function postXmlHttp( submitUrl, callbackFunc ,loadFunc)
{
_postXmlHttpProcessPostChangeCallBack = callbackFunc;
_loadingFunction = loadFunc;
if(window.createRequest)
{
try{
_xmlHttpRequestObj=window.createRequest();
_xmlHttpRequestObj.open('POST',submitUrl,true);
_xmlHttpRequestObj.onreadystatechange=postXmlHttpProcessPostChange;
_xmlHttpRequestObj.send();
}
catch(ee){}
}
else if(window.XMLHttpRequest)
{
_xmlHttpRequestObj=new XMLHttpRequest();
_xmlHttpRequestObj.overrideMimeType('text/xml');
_xmlHttpRequestObj.open('POST',submitUrl,true);
_xmlHttpRequestObj.onreadystatechange=postXmlHttpProcessPostChange;
_xmlHttpRequestObj.send("");
}
else if(window.ActiveXObject)
{
_xmlHttpRequestObj=new ActiveXObject("Microsoft.XMLHTTP");
_xmlHttpRequestObj.open('POST',submitUrl,true);
_xmlHttpRequestObj.onreadystatechange=postXmlHttpProcessPostChange;
_xmlHttpRequestObj.send();
}
};function postXmlHttpProcessPostChange(){
if( _xmlHttpRequestObj.readyState==4 && _xmlHttpRequestObj.status==200 ){
setTimeout( _postXmlHttpProcessPostChangeCallBack, 200 );
}
if ( _xmlHttpRequestObj.readyState==1){
setTimeout( _loadingFunction, 2 );
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货