Ajax返回DataSet时

 function get_city_Result_CallBack(response)
            {
               
if (response.value !=null)
               
{                   
                   
//debugger;
                    document.all("DropDownList2").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].city;
                          var id
=ds.Tables[0].Rows[i].cityID;
                          document.all(
"DropDownList2").options.add(new Option(name,id));                         
                        }

                    }

                }
               
               
return
            }

posted @ 2012-05-21 13:46  小锋神  阅读(122)  评论(0)    收藏  举报