Required library edition:
Required library file: dhtmlxmenu_ext.js
loads menu data from an html and calls onLoadFunction when loading is done
for example, div on the page
<body> <div id="menuData" style="display: none;"> <div id="m1" text="File"> // the first top menu item <div id="m11" text="New" <hotkey>Ctrl+N</hotkey></div>// the first child item <div id="ms1" type="separator"></div> // a separator <div id="m12" text="Open"><hotkey>Ctrl+O</hotkey></div> // the second child item </div> </div> </body>
initing menu
<script> menu.loadFromHTML("menuData", true, function(){}); // od function doOnLoad(){ // code here } menu.loadFromHTML("menuData", true, doOnLoad); </script>