.getMenu()

Previous Next

Fetches a menu.

Returns the 'this' object.

Syntax

.getMenu( options )

 

options  :=  {

    menuName:  menu-name

,   menuFile:  menu-file

,   dir:  directory

,   async:  async

,   success:  success-function

,   error:  error-function

}

 

menu-file   :=  { Menus.xml | }

 

dir         :=  { ../xml/menus/ | }

 

async       :=  { true | false }

Options is a struct that can have the following items, all of which are optional.

Menu-name is a string that is the name of the menu.

Menu-file is a string that is the name of the file containing the menu definition. The default is 'Menus.xml'.

Directory is a relative path to the directory where menu-file is located. Directory is relative to the WebSite directory. The default is '../xml/menus/'.

Async is a boolean that determines whether the operation is performed asynchronously. The default is true.

Success-function is a function called after the operation has successfully completed.

Error-function is a function called if an error occurs.

 

Example

$.udb.getMenu({
    menuName: menuName,

    success: function() {

        var struc = $.udb.menus.menu(menuName);

        if (struc) {

            ...

        }

    }

});