Web Analytics Made Easy -
StatCounter javascript treeview does not work in netscape - CodingForum

Announcement

Collapse
No announcement yet.

javascript treeview does not work in netscape

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • javascript treeview does not work in netscape

    A friend of mine gave a code using javascript in creating a treemenu.I wanted it to be dynamic so I used ASP and access as dbase. It works in IE but not in Netscape. Can you help me with it? thanks.
    <%
    Dim rsCat, j, k, rsSub, sqlX
    Set rsCat = Server.CreateObject("ADODB.REcordset")
    sqlX = "Select * from tbCateg order by Categ asc"
    rsCat.Open sqlX, connect
    j = 1 'Level1
    k = 0 'id=OUTOs, OUT1s, OUT2s / OUTOt, OUT1t, OUT2t increment by 1
    %>
    <%While not rsCat.eof%>
    &nbsp;<a class=Level<%=j%> id=OUT<%=k%>t> <img class=LEVEL1 id=OUT<%=k%>i src="images/plus.gif" border=0>&nbsp;<font face="Arial, Helvetica, sans-serif" size="2" color="#0033CC"><%=rsCat("Categ")%></font></a><br>

    <div id=OUT<%=k%>s style="DISPLAY: none">
    <%Set rsSub = Server.CreateObject("ADODB.Recordset")
    sqlX = "Select * from tbSubCat where CategID=" & rsCat("CategID") & " order by SubCat asc"
    rsSub.Open sqlX, connect
    If not rsSub.eof then
    While not rsSub.eof
    %>
    &nbsp;<img src="images/none.gif" border="0">&nbsp;<font face="Arial, Helvetica, sans-serif" size="1" color="#6699FF"><%=rsSub("SubCat")%></font><br>

    <%
    rsSub.movenext
    Wend
    End if%><br>
    </div>

    <% k = k + 1

    rsCat.movenext
    Wend

    rsCat.close
    set rsCat = nothing
    rsSub.close
    set rsSub = nothing
    %>


    <script language=JavaScript>
    var img1 = new Image();
    img1.src = "images/plus.gif";
    var img2 = new Image();
    img2.src = "images/minus.gif";

    function doOutline() {
    var srcId, srcElement, targetElement;
    srcElement = window.event.srcElement;
    if (srcElement.className.toUpperCase() == "LEVEL1" || srcElement.className.toUpperCase() == "FAQ") {
    srcID = srcElement.id.substr(0, srcElement.id.length-1);
    targetElement = document.all(srcID + "s");
    srcElement = document.all(srcID + "i");

    if (targetElement.style.display == "none") {
    targetElement.style.display = "";
    if (srcElement.className == "LEVEL1") srcElement.src = img2.src;
    } else {
    targetElement.style.display = "none";
    if (srcElement.className == "LEVEL1") srcElement.src = img1.src;
    }
    }
    }

    document.onclick = doOutline;

    </script>
Working...
X