DHTMLX Docs & Samples Explorer

Unload


Source
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxmenu_dhx_skyblue.css">
<script src="../../codebase/dhtmlxcommon.js"></script>
<script src="../../codebase/dhtmlxmenu.js"></script>
 
<div style="height: 250px;"><div id="menuObj"></div></div>
<input type="button" value="Load Menu" onclick="load();">
<input type="button" value="Unload Menu" onclick="unload();">
 
<br>
<script>
var menu;
function load() {
    menu = new dhtmlXMenuObject("menuObj");
    menu.setIconsPath("../common/imgs/");
    menu.loadXML("../common/dhxmenu.xml?etc=" + new Date().getTime());
}
function unload() {
    if (menu)
        menu.unload();
    menu = null;
}
</script>