Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    getElementByTagName not working in Firefox

    I have the following code that I am trying to get working in Firefox. When I call getElementByTagName I get a message saying it is not a function.

    function fncheckcontained(e)
    {
    var lblncontained; // Boolean Variable to hold the status of the ID
    var lstrCurrentItem; //Variable to hole current Item.
    var lstrfoldercontent; //Variable to hold folder content.
    lblncontained=false;
    lstrCurrentItem=ns6Op8? e.target : event.srcElement;

    if (lstrCurrentItem.id=="foldheaderTreeView")
    {
    lblncontained=true;
    }
    else
    while (ns6Op8&&lstrCurrentItem.parentNode||(ie4&&lstrCurrentItem.parentElement))
    {
    if (lstrCurrentItem.id=="foldheaderTreeView"||lstrCurrentItem.id=="foldinglistTreeView")
    {
    lblncontained=(lstrCurrentItem.id=="foldheaderTreeView")? true : false
    break;
    }
    lstrCurrentItem=ns6Op8? lstrCurrentItem.parentNode : lstrCurrentItem.parentElement
    }
    if (lblncontained==true)
    {
    if (ns6Op8) {
    lstrfoldercontent=lstrCurrentItem.getElementByTagName("UL")[0];
    }
    else {
    lstrfoldercontent=lstrCurrentItem.all.tags("UL")[0]
    }
    //lstrfoldercontent=ns6Op8? lstrCurrentItem.nextSibling.nextSibling : lstrCurrentItem.all.tags("UL")[0]
    if (lstrfoldercontent.style.display=="none")
    {
    lstrfoldercontent.style.display=""
    // Ver 1$ Start
    lstrCurrentItem.style.listStyleImage="url(minus.gif)"
    // Ver 1$ End
    }
    else
    {
    lstrfoldercontent.style.display="none"
    // Ver 1$ Start
    lstrCurrentItem.style.listStyleImage="url(plus.gif)"
    // Ver 1$ End
    }
    }
    event.cancelBubble = true;
    }
    Here is the HTML

    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    <TABLE border=0 cellpadding=0 cellspacing=0 width='260' class='gContentSection'>
    <TR>
    <TD class='gContentSection'>
    <UL>
    <LI id=foldheaderTreeView onclick = "javascript:fncheckcontained45411(event);"><U><A onclick="javascript:fnNewWindow45411('http://cnn.com','1')" >Boeing.com</A></U>
    <UL id=foldinglistTreeView style="DISPLAY: none;head: " onclick = "javascript:fncheckcontained45411(event);" >
    <LI id=foldheaderListTreeView onclick = "javascript:fncheckcontained45411(event);"><U><A onclick="javascript:fnNewWindow45411('http://asdf.com','1')" >Inside Boeing</A></U></LI>
    <UL id=foldinglistTreeView style="DISPLAY: none; head: " onclick = "javascript:fncheckcontained45411(event);"> </UL>
    </UL>
    </LI>
    <LI id=foldheaderListTreeView onclick = "javascript:fncheckcontained45411(event);"><U><A onclick="javascript:fnNewWindow45411('\\\\server\\portalimages','1')" >\\server\portalimages</A></U></LI><UL id=foldinglistTreeView style="DISPLAY: none; head: " > </UL><LI id=foldheaderTreeView >No-Link<UL id=foldinglistTreeView style="DISPLAY: none;head: " > <LI id=foldheaderListTreeView ><U><A onclick="javascript:fnNewWindow45411('\\\\server\\portalimages\\paul','1')" >\\server\portalimages\paul</A></U></LI>
    <UL id=foldinglistTreeView style="DISPLAY: block;head: " > </UL>
    </UL>
    </LI></UL>
    </TD>
    </TR>
    <TR><TD class='gContentSection'><I>FireFox Test </I></TD></TR>
    </TABLE>
    </BODY>
    </HTML>

  • #2
    Regular Coder
    Join Date
    Jun 2007
    Location
    USA
    Posts
    527
    Thanks
    26
    Thanked 74 Times in 72 Posts
    Code:
    getElementsByTagName
    Trinithis

  • #3
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can't believe I missed that. Thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •