Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi i m creating menu using css
I want to get the menu path of the page using javascript

For example if my page is coming from this

Settings->Master->Area

How I get this path using javascript
Posted

Try this:

On MenuEvent.ITEM_CLICK event: -

C#
private function menuHandler(event:MenuEvent):void
{
    var pathArray:Array = new Array();
    pathArray.push(event.item.@label);

    var parent:XML = event.item.parent(); 

    while(parent != null)
    {
        pathArray.push(parent["@label"]);
        parent = parent.parent();

    }
    pathArray.reverse();
    trace(pathArray)
}
 
Share this answer
 
v2
Comments
UshaCbe 10-May-13 3:06am    
Hi, thank you foryour reply,is this javascript function? I m using anchor tag for linking page which is in li tag. How can i can this function on my coding,
 
Share this answer
 
Comments
UshaCbe 10-May-13 3:07am    
Hi thank u for your reply. But I m not using sitemap path. I m using ul, li tag using css and javascript for creating menus

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900