下面是截取的代码中关键部分,该代码在其他页面可以调用,可是我复制到这个页面就无法实现了,清空了所有代码,只留下这段代码和连接数据库,还是无法出来。
求分析解释。谢谢。
<%
dim rsclass
dim sqlclass
dim count
set rsclass=server.createobject("adodb.recordset")
sqlclass = "select * from FOX_shi order by paixu desc"
rsclass.open sqlclass,conn,1,1
%><SCRIPT language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rsclass.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rsclass("shi"))%>","<%= trim(rsclass("sheng"))%>","<%= trim(rsclass("id"))%>");
<%
count = count + 1
rsclass.movenext
loop
rsclass.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.shi.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.shi.options[document.myform.shi.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</SCRIPT><%
sqlclass = "select * from FOX_sheng order by paixu desc"
rsclass.open sqlclass,conn,1,1
if rsclass.eof and rsclass.bof then
response.write "请先添加栏目。"
response.end
else
%><SELECT name="sheng" onChange="changelocation(document.myform.sheng.options[document.myform.sheng.selectedIndex].value)" size="1" class="right_bg01">
<OPTION selected value="0">==分类==</OPTION>
<%do while not rsclass.eof
%>
<OPTION value="<%=trim(rsclass("id"))%>"><%=trim(rsclass("sheng"))%></OPTION>
<%
rsclass.movenext
loop
end if
rsclass.close
set rsclass=nothing
%>
</SELECT>
<SELECT name="shi" size="1" class="right_bg01">
<OPTION selected value="0">==二级分类==</OPTION>
</SELECT>
结贴把