View Full Version : Ajax-driven accordion, question

06-15-2012, 09:52 AM
1) Script Title: Accordion Content Script 2.0

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordion.htm

3) Describe problem:

Im new to the Ajax approach to things. It is not clear to me exactly ‘how’ the accordion data flow is supposed to work in a case where you prepopulate Level1 nodes, but you want to dynamically populate Level2 nodes only on click/expansion of a Level1 node.

For example, is the call to retrieve the content for the Level2 node(s) made via a link to some page (<a class="hiddenajaxlink" src="mycontent.htm&1_1">Category 1</a>)? Or, do I need to leverage the onopenclose:function (as in http://www.dynamicdrive.com/forums/showthread.php?t=31925)?

And, if both are viable, are there implications on caching that might favor one?

It seems that all the sample code has the accordion menus fully prepopulated- so I remain a bit lost as regards the data flow, if a definition of the Level1 node under which you want to append Level2 nodes is implied via the click event, etc.

Any pseudo code, or references to relevant (dynamically populating child node) sample code would be greatly appreciated-