[jQuery] Re: Insert Html and a Javascript function with Jquery .html

2009-04-08 Thread Fish Marketing
Thanks James! I finally got something going as soon as you posted. Ironically, this solution was very close to yours. I will marry the best of both! jQuery(function($){ var i; for (i in menu1) { var menuItem = menu1[i]; $('.MainMenuItems').append(menuItem);

[jQuery] Re: Insert Html and a Javascript function with Jquery .html

2009-04-08 Thread James
function buildMenu(myMenu) { var i, menuItems = ''; var $menu = $(''); for (i in menu1) { menuItems += menu1[i]; } var menuHTML = $menu.append(menuItems); $(myMenu).html(menuHTML); } buildMenus('.MainMenu'); It's untested, but does something like this