这个代码系统提示 style.display 为空或不是对象,错在哪里?
系统提示 style.display 为空或不是对象,而且运行时,要隐藏的都没有隐藏起来。------------------------------------------------------------源代码如下---------------------------------------------------------------------
<script language=javascript>
function show(y){
if (y.style.display == "none") {
y.style.display = "";
}else{
y.style.display = "none";
}
} </script>
<form action="" method="post" name="form1" id="form1">
<table width="99%" border="5" align="center" cellpadding="5" cellspacing=5 bordercolor="#CCCCCC" bgcolor="#FFFFFF">
<tr bgcolor="#F7F7F7">
<td height="20" colspan="2" background="images/topbg.gif" bgcolor="#F7F7F7"><span class="STYLE1"><img src="images/pic5.gif" width="28" height="22" align="absmiddle" />您现在所在的位置是: <a href="adminhelp.asp">管理首页</a> -> <span class="STYLE2">类别管理</span></span></td>
</tr>
<%
sort(0)
dim ii
ii=0
sub sort(selec)
y=0
sql="select * from category where ParentID = "&selec&" order by categoryorder"
Set Rs1=Conn.Execute(sql)
do while not rs1.eof
if selec=0 then
%>
<tr bgcolor="#f7f7f7" height=25>
<td background="images/topbg.gif" bgcolor="#f7f7f7"> <a href=b2b_addfl.asp?categoryid=<%=int(rs1("categoryid"))%>&action=edit><b>
<%response.write rs1("categoryorder")&". "&rs1("category")%></b></a></td>
<td width="400" align="right" background="images/topbg.gif">
<%=y%><strong><img src="IMAGES/PIC24.GIF" width="17" height="13" align="absmiddle"><a href="#" //// onclicks 为特意加上S的,否则该发帖系统会把这段代码删掉////>展开分类</a> | <a href=b2b_addfl.asp?categoryid=<%=int(rs1("categoryid"))%>&action=add>添加二级分类</a> | <a href=b2b_addfl.asp?categoryid=<%=int(rs1("categoryid"))%>&action=edit target="_blank">编辑分类</a> |
<a href="b2b_addfl.asp?categoryid=<%=int(rs1("categoryid"))%>&action=delok" >删除分类</a></strong></td>
</tr>
<%
else
'------------------------------------------------------隐藏类别块开始-----------------------------------------------------------------%>
<DIV id=a<%=y%> style="DISPLAY: none"><tr bgcolor="#FFFFFF" height=25><td><input name="selectid" type="checkbox" id="selectid" value="<%=rs1("categoryid")%>" />
<%=string(ii*2," ")%><a href=b2b_addfl.asp?categoryid=<%=int(rs1("categoryid"))%>&action=edit><%response.write rs1("categoryorder")&". "&rs1("category")%></a></td><td width="300" align="right">
<a href=b2b_addfl.asp?categoryid=<%=int(rs1("categoryid"))%>&action=add><img src="images/pic10.gif" width="20" height="15" border="0" align="absmiddle" />添加
<% = ii+2 %>
级分类</a> <img src="images/pic11.gif" width="20" height="15" align="absmiddle" /><a href=b2b_addfl.asp?categoryid=<%=int(rs1("categoryid"))%>&action=edit target="_blank">编辑分类</a> <img src="images/pic12.gif" width="20" height="15" align="absmiddle" /><a href="b2b_addfl.asp?categoryid=<%=int(rs1("categoryid"))%>&action=delok" >删除分类</a></td></tr></div>
<%'--------------------------------------------------------隐藏类别块结束--------------------------------------------------------------
end if
ii=ii+1
sort rs1("categoryid")
ii=ii-1
y=y+1
rs1.movenext
loop
rs1.close
Set Rs1 = Nothing
end sub
%></table>
<div align="center"><br>
<input type="submit" name="Submit" value="删除选项" >
</div>
</form>
[[italic] 本帖最后由 kira007 于 2007-12-6 11:28 编辑 [/italic]]