JavaScript/ASP/Menutræ!
Jeg har problemer med følgende script:<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<!-- #Include file=\"data.asp\" -->
<%
Dim SQL \'SQL streng
Dim rs \'Recordset udtræk
Dim count \'Recordset udtræk
%>
<html>
<head>
<title>YoungShopper Admin.Sys</title>
<style>
a:link {font-family: Verdana; font-size: 12px;}
a:visited {font-family: Verdana; font-size: 12px;}
</style>
</head>
<body>
<%
\'SQL = \"SELECT * FROM categories\"
\'Set rs = Conn.Execute(SQL)
\'If Not rs.EOF Then
\' rs.close
\' Set rs = Nothing
\' response.redirect \"create.asp?error=1\"
\'Else
\' Response.Write(\"den findes ikke\")
\'End If
%>
<!--
<form action=\"default.asp?add=menu\" method=\"post\">
<table>
<tr>
<td>Kategori</td>
<td><input type=\"text\" name=\"categori\"></td>
</tr>
<tr>
<td>Underkategori</td>
<td><input type=\"text\" name=\"undercategori\"></td>
</tr>
<tr>
<td></td>
<td><input type=\"submit\" value=\"opret\"></td>
</tr>
</table>
</form>
-->
<%
SQL = \"SELECT * FROM categories\"
Set rs = Conn.Execute(SQL)
SQLCOUNT = \"SELECT COUNT(*) FROM categories\"
Set count = Conn.Execute(SQLCOUNT)
%>
<script language=\"JavaScript\">
function ShowSub1Mnu(show)
{
for (i = 1; i < <%= count(0) %> + 1; i++) {
if (i != show) {
document.getElementById(\"mnu\" + i).style.display = \"None\"
}
else {
document.getElementById(\"mnu\" + show).style.display = \"\"
}
}
}
function ShowSub2Mnu(show) {
for (iN = 1; iN < <%= count(0) %> + 1; iN++) {
if (iN != show) {
document.getElementById(\"subMnu\" + iN).style.display = \"None\"
}
else {
document.getElementById(\"subMnu\" + show).style.display = \"\"
}
}
}
</script>
<table cellpadding=\"0\" cellspacing=\"0\">
<%
While Not rs.EOF
%>
<tr>
<td style=\"Cursor:Hand;\"><img src=\"img/navi_In.gif\" onClick=\"ShowSub1Mnu(<%= rs(\"catID\") %>)\"> </td>
<td onClick=\"ShowSub1Mnu(<%= rs(\"catID\") %>)\" style=\"Cursor:Hand;\"><% Response.Write(rs(\"categories\")) %></td>
</tr>
<tr>
<td></td>
<td>
<div id=\"mnu<%= rs(\"catID\") %>\" style=\"Display:\'None\';\">
<%
SQL = \"SELECT * FROM childCats WHERE catID =\'\" & rs(\"catID\") & \"\'\"
Set rsChildCats = Conn.Execute(SQL)
%>
<table cellpadding=\"0\" cellspacing=\"0\">
<%
While Not rsChildCats.EOF
%>
<tr>
<td style=\"Cursor:Hand;\" onClick=\"ShowSub2Mnu(<%= rsChildCats(\"underID\") %>);\">
<img src=\"img/navi_In.gif\" border=\"0\"> <% Response.Write(rsChildCats(\"childCats\")) %>
<div id=\"subMnu<%= rsChildCats(\"mnuID\") %>\" style=\"Display:\'None\';\">
<table cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td> </td>
<td><img src=\"img/navi_Out.gif\"> test</td>
</tr>
</table>
</div>
</td>
</tr>
<%
rsChildCats.MoveNext
Wend
%>
</table>
</div>
</td>
</tr>
<%
rs.MoveNext
Wend
%>
</table>
</body>
</html>
Jeg kan ikke få under menuerne frem under tøj!
(eksempel kan ses på www.youngshopper.com/rune/ )
PlZ Help
