把数组添加到select的option···
问一个把数组添加到select的option的问题··
有两个<select>标签,第一个<select>的option绑定的是从数据库里面查询的大类的名称
在点击了第一个<select>里面的选项后,在第二个<select>中添加 属于这个大类的小类的名称····
同时,有一个获取数组的函数···
function GetTableResult(sql,args){ var xml = new XMLHttpRequest(); xml.open("post","Common__Data.aspx",false); xml.seRequestHeader('Content-Type','applicetion/x-www-form-urlencoded'); if (args != null) args = "&" + args; else args=""; xml.send("____sql=" +escape(sql.replace(".","##").replace("%","¥")) + args); try{ window.eval(String(xml.responseText)); return datatable; } catch(err){ alert(err.description); return new Array }