Hi guys,
I am quite new to the javascript. I have the following java script which should allow me to open a submenu. The scenario is that i trigger two events at the same time. One is when i click on the menu it should open a submenu and along with it, it also opens a new page. and i have a javascript which sets a cookie so if a menu is open and i go to another menu, then the previous menu remain open when i come back to it later. i am not sure what to do because it works fine in firefox and in the rest of the browsers like firefox but with IE it doesnt. please help me if you guys could. you could check this on the website which i am working on at http://www.gecoc.de. there you can see on the left hand side there are few menus.
This is a function to set a cookie
function getCookie(name){
var i = 0;
var suche = name + "=";
while(i<document.cookie.length){
if(document.cookie.substring(i, i + suche.length) == suche){
var ende = document.cookie.indexOf(";", i + suche.length);
ende = (ende > -1) ? ende: document.cookie.length;
var inhalt = document.cookie.substring(i + suche.length, ende);
return unescape(inhalt);
}
i++;
}
return "";
}
and this is where i call this for different submenus
<script ="text/javascript">
var temp;
temp = getCookie("Projekte");
if(temp == "true"){
showMenu("Projekte");
}
temp = getCookie("Partner");
if(temp == "true"){
showMenu("Partner");
}
temp = getCookie("Mitgliedschaft");
if(temp == "true"){
showMenu("Mitgliedschaft");
}
</script>