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

<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>

posted on 2007-10-11 16:48  一路前行  阅读(287)  评论(0编辑  收藏  举报