Problem med javascripmenu i IE 7.0
Hej drenge og piger,Yes, så er jeg tilbage med (akut) brug for hjælp.
Jeg har et CMS med en menu i "træstruktur". Ved opdateringen til IE 7.0 virker denne menu ikke mere. Er der mulighed for at ændre noget i browseren, som "pisset" vil virke igen???
<script language="JavaScript">
var httpObj = new ActiveXObject("Microsoft.XMLHTTP");
function send(sData,sTarget)
{
httpObj.Open("POST", sTarget, true, "", "");
httpObj.setRequestHeader("Content-Type","text/xml");
httpObj.Send (sData);
window.status = "Load in progress | ";
checkReadyState()
}
function checkReadyState()
{
if (httpObj.readyState == 4)
{
AppendChildren(httpObj.ResponseXML);
window.status = " ";
}
else
{
AnimateWindowStatus();
window.setTimeout("checkReadyState()", 50);
}
}
function ClkItem()
{
idClicked.innerHTML = " <a href='ContentEdit.asp?Editor_ID=1&CMS_ID=" + event.srcElement.getAttribute('ElementID') + "'><strong>" + event.srcElement.getAttribute('ElementText') + "</strong></a> | " + "<a href='ContentAdd.asp?Editor_ID=1&CMS_Parent=" + event.srcElement.getAttribute('ElementID') +"'>Add Sub-Page</a>" + " | " + "<a href='Delete_Content.asp?DeleteID=" + event.srcElement.getAttribute('ElementID') + "'>Delete this Web Page</a>" + " | http://www.comitel.dk/" + "Default.asp?Page=" + event.srcElement.getAttribute('ElementID') + " <a href='http://www.comitel.dk/?Page=" + event.srcElement.getAttribute('ElementID') +"'><img src='images/Preview.gif' width='18' height='18' border='0'></a>" ;
}
function BuildTree()
{
if (event.type == 'load')
{
if (typeof(divTree0)!='object')
send("","GetChildren.asp?Level=0");
}
else
{
try
{
objManip = eval('divTree' + event.srcElement.getAttribute('ElementId'));
if (objManip.style.display == 'none')
{
objManip.style.display = '';
eval("img" + event.srcElement.getAttribute('ElementId') + ".src = 'images/minus.gif';");
}
else
{
objManip.style.display = 'none';
eval("img" + event.srcElement.getAttribute('ElementId') + ".src = 'images/plus.gif';");
}
}
catch (e)
{
if(event.srcElement.getAttribute('ElementId')==null)return;
send("","GetChildren.asp?Level=" + event.srcElement.getAttribute("ElementId"));
eval("img" + event.srcElement.getAttribute('ElementId') + ".src = 'images/minus.gif';");
}
event.cancelBubble = true;
}
}
function AppendChildren(oDoc)
{
var RowLength = (oDoc.documentElement.selectNodes("Row").length);
if(RowLength==0) return;
var intParentID;
intParentID = oDoc.documentElement.selectNodes("Row")[0].childNodes(1).text;
var oMain;
oMain = document.createElement('DIV');
oMain.id = 'divTree' + intParentID;
if(intParentID==0)
oMain.style.cssText = 'position:relative;left:0px;cursor:hand;';
else
oMain.style.cssText = 'position:relative;left:25px;cursor:hand;';
var intID;
var sText;
var oTmp;
for (var iCnt=0;iCnt<RowLength;iCnt++)
{
intID = oDoc.documentElement.selectNodes("Row")[iCnt].childNodes(0).text;
sText = oDoc.documentElement.selectNodes("Row")[iCnt].childNodes(2).text;
sText2 = oDoc.documentElement.selectNodes("Row")[iCnt].childNodes(3).text;
sMenuType = oDoc.documentElement.selectNodes("Row")[iCnt].childNodes(4).text;
oTmp = document.createElement("<DIV onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='black';\" OnClick='BuildTree();ClkItem();' OnSelectStart='return false;'>");
oTmp.id = 'div' + intID;
if(intParentID==0)
oTmp.innerHTML = "<IMG width=25 height=1 SRC='images/t_dot.gif'><IMG ElementId='" + intID + "' id='img" + intID + "' SRC='images/plus.gif'> " + sText;
else
oTmp.innerHTML = "<IMG ElementId='" + intID + "' SRC='images/dot.gif'><IMG ElementId='" + intID + "' id='img" + intID + "' SRC='images/plus.gif'> " + sText;
oTmp.setAttribute('ElementId', intID);
oTmp.setAttribute('ElementText', sText2);
oTmp.setAttribute('ElementType', sMenuType);
oTmp.style.cssText = "cursor:hand;color:darkblue;font-size:x-small;";
oMain.appendChild(oTmp);
}
//alert(oMain.innerHTML);
if (intParentID=='0')
tree.appendChild(oMain);
else
eval('div' + intParentID).appendChild(oMain);
//alert(tree.innerHTML);
}
</script>
Mange hilsner,
Rasmus