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>

你可能感兴趣的:(Ajax)