[Javascript] Create a menu in js. Understanding the workflow

MEM talofo at gmail.com
Tue Oct 27 04:39:41 CDT 2009


Hello all,

I'm on my way for building a menu using javascript. 

If I search for js menu on google, I get "23523523 free build now menus
etc..." 
But I would like to understand and see, the process involving the creation
of a js menu that needs to be unobtrusive. 

For this database menu I need to:
Have a menu that, when the user clicks: 
a) show the child elements of that clicked parent.
b) change the URL.
I don't mind about reloading.

The server side part:
1) Construct an array from a query.
2) Build a ul/li List based on that array
3) Print it out to the page.

The client-side part:
4) I suppose I should I give to the li and ul some ids, so that we can show
child elements only when a specific parent is clicked? But we add this ul/li
ids on the server side code, or on the client-side code?

5) Each time the user clicks on a menu item, the URL must change. How to
preserve the menu estates over this url changes?


Some questions may not make too much sense for an experimented look, and are
related with my confusion, but what I really like to understand is the
procedures for creating something like this.

Could I have your help on this?


Thanks a lot,
Márcio




More information about the Javascript mailing list