缺少对象JavaScript

xiaocheng517 2008-04-01 07:00:26
var subcat2 = new Array();

提示这行char 1 缺少对象

大家帮我看看是怎么回事?
...全文
109 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
xiaocheng517 2008-04-01
我知道了,多了一个}
回复
文盲老顾 2008-04-01
应该不是你说的那行错。。。
回复
hunshihaichong 2008-04-01
var subcat2 = new Array();
subcat2[0] = ['s1'];
subcat2[1] = ['s2'];
回复
xiaocheng517 2008-04-01
<%
dim rs,rs2
dim sql,sql2
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass order by SmallClassID asc"
rs.open sql,conn,1,1
set rs2=server.createobject("adodb.recordset")
sql2 = "select * from TinyClass order by TinyClassID asc"
rs2.open sql2,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation()
{
document.addform.SmallClassName.length = 1;
var locationid=addform.BigClassName.options[document.addform.BigClassName.selectedIndex].value;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.addform.SmallClassName.options[document.addform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
var onecount2;
subcat2 = new Array();
<%
count2 = 0
do while not rs2.eof
%>
subcat2[<%=count2%>] = new Array("<%= trim(rs2("TinyClassName"))%>","<%= trim(rs2("SmallClassName"))%>","<%= trim(rs2("TinyClassName"))%>");
<%
count2 = count2 + 1
rs2.movenext
loop
rs2.close
%>
onecount2=<%=count2%>;

function changelocation2()
{
document.addform.TinyClassName.length = 1;
var locationid2=addform.SmallClassName.options[document.addform.SmallClassName.selectedIndex].value;
var i;
for (i=0;i < onecount2; i++)
{
if (subcat2[i][1] == locationid2)
{
document.addform.TinyClassName.options[document.addform.TinyClassName.length] = new Option(subcat2[i][0], subcat2[i][2]);
}
}
}
}
</script>
回复
文盲老顾 2008-04-01
孤零零的一句。。。怎么看
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2008-04-01 07:00
社区公告
暂无公告