您的位置:首页 > 其它

Ajax.dll实现无刷新二级联动

2007-10-11 16:48 639 查看
<SCRIPT language="javascript">

function cityResult()

{

var city=document.getElementById("DdlProvince");

AjaxMethod.GetCityList(city.value,get_city_Result_CallBack);

}

function get_city_Result_CallBack(response)

{

if (response.value != null)

{

//debugger;

document.all("DdlCity").length=0;    

     var ds = response.value;

if(ds != null && typeof(ds) == "object" && ds.Tables != null)

{

for(var i=0; i<ds.Tables[0].Rows.length; i++)

     {

     var name=ds.Tables[0].Rows[i].Info;

       var id=ds.Tables[0].Rows[i].ProvinceID;

       document.all("DdlCity").options.add(new Option(name,id));

     }

}

}

return

}

</SCRIPT>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: