骆驼 SuperComboBox.HTC问题:
SuperComboBox.HTC问题:下载了骆先生的SuperComboBox.HTC,只在示例上加了document.all("ddd").innerHTML="<input type=\"text\" name=\"TB\" id=\"TB5\" class=\"eSelect\" DataSourceType=\"array\" Scroll=\"0\" DropListWidth=\"170px\" size=\"20\">";及document.all("TB5").SetArrayData(data);
发现
document.all("TB5").SetArrayData(data);
无法运行,而其它的
document.all("TB2").SetArrayData(data);
document.all("TB4").SetArrayData(data);
运行正常;
实际上"TB5"与"TB4"完全一致。只是一个由js动态添加到<div id=ddd></DIV>中。
<HTML>
<HEAD>
<TITLE>Joesen's 加强的下拉框</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="Blog,ASP,PHP,designing,with,web,standards,xhtml,css,joesen,Joesen,下拉框,combobox" />
<style type="text/css">
<!--
.eSelect {
behavior: url(SuperComboBox.HTC);
}
-->
</style></HEAD>
<script language="javascript">
function TestMethod() {
document.all("ddd").innerHTML="<input type=\"text\" name=\"TB\" id=\"TB5\" class=\"eSelect\" DataSourceType=\"array\" Scroll=\"0\" DropListWidth=\"170px\" size=\"20\">";
var data=new Array(5);
data[0]=new Array("语言");
data[1]=new Array("简体");
data[2]=new Array("繁体");
data[3]=new Array("英语");
data[4]=new Array("法语");
document.all("TB2").SetArrayData(data);
document.all("TB4").SetArrayData(data);
document.all("TB5").SetArrayData(data);
var data=new Array(3);
data[0]=new Array("姓名","性别","班级","科目","分数");
data[1]=new Array("张三","男","9622","语文","90");
data[2]=new Array("王四","女","9721","数学","85");
data[3]=new Array("李五","男","9805","英语","88");
document.all("TB3").SetArrayData(data);
}
</script>
<BODY bgcolor="menu" onload="TestMethod();">
<input type="text" name="TB" id="TB2" class="eSelect" DataSourceType="array" Scroll="0" DropListWidth="170px" size="20" value="英语">
<br><br>
<input type="text" name="TB" id="TB4" class="eSelect" DataSourceType="array" Scroll="0" DropListWidth="170px" size="20">
<br>
<div id="ddd"></div>
<br>
<input type="text" name="TB" id="TB3" class="eSelect" DataSourceType="array" Scroll="0" ColWidth="15%,35%,15%,35%" DropListWidth="260px" size="30">
</BODY>
</HTML>