Hallo!
erstmal danke für deine antwort!
ich kann schon das gesamte dokument hier reinkopieren. aber wahrscheinlich killst du bzw. ihr mich... ist ziemlich groß... aber ich mach trotzdem mal... aber bitte: net bös sein ;-)
<html> <head> <title>TopMenu</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="../sh-layout.css" type="text/css"> <script language="JavaScript" src="sh-menu.js"/> <!-- // Includieren der Menu-Definitionen. // --> </script>
<script language="JavaScript" src="../sh-cookie.js"> <!-- // Includieren der Cookies // --> </script>
<script language="JavaScript"> <!-- function getCurrentFile() { // den Namen zwischen speichern. sTemp = parent.content.location.href; iPos = sTemp.lastIndexOf ( "/" );
// So nachdem wir nun die Position des letzten Zeichens in der Kette ermittelt haben, // koennen wir nun den Filename bestimmen.
sTemp = sTemp.substring ( iPos + 1, sTemp.length );
// noch schauen, ob parameter angefügt sind iPos = sTemp.lastIndexOf ( "?" ); if (iPos >= 0) { sFileName = sTemp.substring ( 0, iPos ); } else { sFileName = sTemp; }
return sFileName; }
function getCurrentPath() { // den Namen zwischen speichern. sTemp = parent.content.location.href; iPos = sTemp.lastIndexOf ( "/" ); sTemp = sTemp.substring ( 0, iPos );
iPos = sTemp.lastIndexOf ( "/" ); sTemp = sTemp.substring ( iPos + 1, sTemp.length );
return sTemp; }
function DrawMenu() {
if (document.layers)
{
sFileName = getCurrentFile(); // Jetzt hole mal die Position des FileNamens und stelle alle Elemente dar. buttontext = ''; arPages = new SetPages(); for ( var i = 1; i <= arPages.length; i++ ) { if ( arPages [ i ].url == sFileName ) {
document.Lerneinheit.document.Lerneinheitdrinnen.document.open(); document.Lerneinheit.document.Lerneinheitdrinnen.document.fgColor = "black"; document.Lerneinheit.document.Lerneinheitdrinnen.document.write( "<font color=black face='verdana,arial,helvetica,sans-serif' size='-1'><b><a href='sh-lerneinheit-thema-1.htm' target='content' class='topheader'>" + arPages [ i ].lerneinheit + "</a> - " + arPages [ i ].thema + "</b></font>" ); document.Lerneinheit.document.Lerneinheitdrinnen.document.close();
updateCookie();
// document.Thema.left = document.Lerneinheit.left + document.Lerneinheit.width; // document.Thema.document.Themadrinnen.document.open(); // document.Thema.document.Themadrinnen.document.fgColor = "black"; // document.Thema.document.Themadrinnen.document.write( arPages [ i ].thema ); // document.Thema.document.Themadrinnen.document.close();
// document.Lerneinheit.bgColor = "yellow"; // document.layers["Lerneinheit"].document.write( arPages [ i ].lerneinheit ); // document.layers["Thema"].document.write( arPages [ i ].thema );
// document.getElementById('Lerneinheit').firstChild.nodeValue = arPages [ i ].lerneinheit; // document.getElementById('Thema').firstChild.nodeValue = arPages [ i ].thema;
}
}
}
else { sFileName = getCurrentFile(); // Jetzt hole die mal die Position des FileNamens und stelle alle Elemente dar.
// Erstmal malen wir alle Buttons wieder grau. for(i = 0; i < document.getElementsByTagName("td").length; i++) { el=document.getElementsByTagName("td")[i]; if (el.id.substring(0,5)=="thema") { el.style.backgroundColor = "#999999"; } }
// welche seite soll denn angezeigt werden ?
arPages = new SetPages();
for ( var i = 1; i <= arPages.length; i++ ) { if ( arPages [ i ].url == sFileName ) {
document.getElementById('Lerneinheit').firstChild.nodeValue = arPages [ i ].lerneinheit; document.getElementById('Thema').firstChild.nodeValue = arPages [ i ].thema;
// und jetzt noch den Button malen. document.getElementById('thema' + String( i )).style.backgroundColor="#666666"; updateCookie(); }
}
}
return;
}
function openPrintWindow() { sFileName = getCurrentFile(); mywin = window.open(sFileName + "?mode=print","Drucken", "menubar=yes,scrollbars=yes,resizable=yes,width=550,height=400"); mywin.focus(); return true; }
<!-- ruft popupfenster glossar auf --> function PopupFenster() { F = window.open("../sh-glossar.htm", "Popup", "width=800,height=600,left=100,top=100,scrollbars=yes,resizable=yes" ); }
<!-- ruft popupfenster hilfe auf -->
<!-- function PopupFensterHilfe() { F = window.open("../sh-hilfe.htm", "Popup", "width=800,height=600,left=100,top=100,scrollbars=yes,resizable=yes" ); }
function PopupTag() { F = window.open("../tagverzeichnis/sh-lerneinheit-frame.htm", "tag", "width=800,height=600,left=100,top=100,scrollbars=yes,resizable=yes" ); }
// --> </script>
</head>
<!--- <body bgcolor="#FFFFFF" text="#000000"> --->
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#8A8A8A" align="right"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="topMenuText"> Sparkassenakademie Bayern</td> <td align="right"> <table border="0" cellspacing="2" cellpadding="3"> <tr align="center" bgcolor="#999999"> <td class="topButton" onMouseOver="pviiClassNew(this,'topButtonActive')" onMouseOut="pviiClassNew(this,'topButton')"><a href="../index.htm?init=0" target="_top" class="topButtonLink">Home</a></td> <td class="topButton" onMouseOver="pviiClassNew(this,'topButtonActive')" onMouseOut="pviiClassNew(this,'topButton')"><a href="javascript:PopupFensterHilfe()" class="topButtonLink">Hilfe</a></td> <td class="topButton" onMouseOver="pviiClassNew(this,'topButtonActive')" onMouseOut="pviiClassNew(this,'topButton')"><a href="javascript:PopupFenster()" class="topButtonLink">Glossar</a></td> <td class="topButton" onMouseOver="pviiClassNew(this,'topButtonActive')" onMouseOut="pviiClassNew(this,'topButton')"><a href="javascript:PopupTag()" class="topButtonLink">Tags</a></td> <script language="Javascript"> var NS = (navigator.appName == "Netscape"); var VERSION = parseInt(navigator.appVersion); if (VERSION > 3) { document.write('<td class="topButton" onMouseOver="pviiClassNew(this,'topButtonActive')" onMouseOut="pviiClassNew(this,'topButton')"><a href="#" onClick="openPrintWindow()" class="topButtonLink">Drucken</a></td>'); } </script> <td class="topButton" onMouseOver="pviiClassNew(this,'topButtonActive')" onMouseOut="pviiClassNew(this,'topButton')"><a href="javascript:parent.window.close()" class="topButtonLink">Schließen</a></td>
</tr> </table> </td> </tr> </table> </td> </tr> <tr> <td bgcolor="#CCCCCC"> <table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <script language=javascript> if (document.layers) { document.open() document.write('<td><a href="../index.htm?init=0" target="_top" class="topHeader">HTML KURS</a> - <ilayer id=0 name="Lerneinheit" visibility="show" z-Index=2 width="400" top="2"><layer name="Lerneinheitdrinnen" clip=""><a href="sh-lerneinheit-thema-1.htm" target="content" class="topHeader">Lerneinheit</a> - Thema</layer></ilayer> </td>'); document.close(); } else { document.open() document.write('<td class="topHeader"><a href="../index.htm?init=0" target="_top" class="topHeader">HTML KURS</a> - <a href="sh-lerneinheit-thema-1.htm" target="content" class="topHeader"><span id="Lerneinheit">Lerneinheit</span></a> - <span id="Thema">Thema</span></td>'); document.close(); } </script> <td align="right"> <table border="0" cellspacing="2" cellpadding="2"> <tr> <script language="JavaScript"> <!-- arPages = new SetPages();
for ( var i = 1; i <= arPages.length; i++ ) { document.write ( '<td class="topButton" onMouseOver="pviiClassNew(this,'topButtonActive')" onMouseOut="pviiClassNew(this,'topButton')" id="thema' + i + '" bgcolor="#999999"><a target="content" class="topButtonLink" href="' + arPages [ i ].url + '">' + i + '</a></td>' ); } // --> </script> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> </html>
Hallo!
wo wird denn der code ausgeführt? gibt es an der stelle das html-document schon bzw. den body (also erst nach dem onload() ereignis am besten in einer funktion ausführen) ? was ist das ?
document.Lerneinheit.document.Lerneinheitdrinnen.document.open();
also document ist ja richitg, aber der rest ? das nächste ist richtig
document.open() ...
könnten halt mehrere fehlerquellen sein. man müsste das kompl. dokument ( die einbettung des scriptes )einsehen können.