Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

RECURSIVE FUNCTION FOR AN ASP FORUM

Posted on 2002-07-15
3
241 Views
Last Modified: 2006-11-17
I have a Tree view forum.
I need to create a recursive javascript function in order to 'close messages' (I use the display property - block/none) and their children.

Each item of the tree is in a <TR> named "rec" with a unique ID which is structed like ID="TopParentID,Level,MessageID,ParentID".

 -TopParentID=Top most message of the thread
 -Level=Level of the current messege within the thread
 -MessageID=Message ID
 -ParentID=Parent ID of the current message.

here is what I did: (and doesn't work)
--------------------
***the GetTree function is being called upon closing an item in the thread

function GetTree(ParID)
{

allTRs=document.all.tags("tr")
TRLength=allTRs.length
     
for (i=0;i<TRLength;i++)
     {
      if (allTRs.item(i).name=="rec" )
          {
                   
               var Arrsplit=allTRs.item(i).id.split(",");
               var SunID=Arrsplit[0]
               var LevelThread=Arrsplit[1]
               var MesID=Arrsplit[2]
               var ParentID=Arrsplit[3]
               if (ParentID==ParID)
                    {
                    eval("document.all('"+SunID+","+LevelThread+","+MesID+","+ParentID+"').style.display='none'")
                    GetTree(MesID)          
                    }
         
               
          }
         
     }          
               
               
}
0
Comment
Question by:meme_25
3 Comments
 
LVL 3

Expert Comment

by:mastallama
ID: 7154816
You can use <DIV> tags and JavaScript to make it work.  Just have the JavaScript show and hide the <DIV> tags, the only possible problem with this would be when the page initially loads.  If there are thousands of threads on one page, it would load them all before allowing the user to navigate the page.

~ MastaLlama ~
0
 
LVL 33

Expert Comment

by:hongjun
ID: 7510482
This question appears to have been abandoned. Please come back to this question and do the necessary evaluation or feedback. I will invite a Moderator to close this question if there's no reply from you after seven days.

I suggest
<delete>

** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **

hongjun
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 7551610
PAQ'd and points removed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
I am getting ASP error  xmlParseEntityRef: no name. Anyone can help ? 1 72
Get hold of longitude and latitude in iframe string 11 48
Help with query 3 31
IIS components 2 16
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question