Topic: Main.tpl and inserting onload .js aswell as div and style of div
I'm working on a extension that puts a dropdown menu on my site. See here for working example. Some of the .js I'm already calling via extension manifest.xml. However main.tpl remains my issue.
The first and last line are what is already in main.tpl ... there's also body tag, but I'm adding the onload of the ajax and then the div and the script....
My question: What would the elegant way be to do this all via the extension?
</head>
<body onload="initMenu()">
<div style= "left: 68px; top: 6px; position: absolute; border: 0px;">
<div id="menuObj"></div>
</div> <div class="content">
<script>
var menu;
function initMenu() {
menu = new dhtmlXMenuObject("menuObj");
menu.setIconsPath("http://forum/extensions/dhtmlx_menu/ajx/samples/common/imgs/");
menu.loadXML("http://forum/extensions/dhtmlx_menu/ajx/samples/common/dhxmenu.xml?etc="+new Date().getTime(),function(){
// menu.addNewSeparator("file");
});
}
</script>
</div>
<div id="brd-wrap" class="brd">