I am creating an online products catalog. In this I want to create a menu that is loaded dynamically. The menu consists of categories that may have sub-categories and leaf nodes are the products.
There is a table called categories having 3 fields catId, title, and parentCatId(Id of the parent category).
On the page, I am able to display all the top level categories. Now, what I want to do is- when a user clicks on a category(or a subcategory), it should expand and show the subcategories(if applicable) and products(leaf nodes). When a user clicks on a leaf node, it should go to page, say, product.php and the page should know what link was clicked.
Creating menu's dynamically is pretty straight forward.
Html doesn't have cascading menus, that's usually done with multiple menus. (you've seen them as a product menu then when you select that you get a model and when you select that you get a version menu)
If you're going to do php only the process would be set one menu item then hit next then php redraws the page and on and on.
From your question, I would suggest using the php only method for Version 1, it is MUCH MUCH simpler.
Once you get the hang of Ajax it's pretty cool and I don't want to discourage you at all from using it. it does take some time to learn to use effectively.
It's not what your program can do, it's what your users do with the program.
Paper beats rock. Scissors beats tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop