Einzelnen Beitrag anzeigen
Alt 26.09.2004, 19:20   #14
jak
Inventar
 
Registriert seit: 13.06.2001
Beiträge: 1.830


Standard

Ich hab's bei mir jetzt so zum laufen gebracht:
Auf den Seiten:
Code:
<script>
if (top.location.href.indexOf('main.html')==-1){
	document.location.href = 'main.html?seite2.html';
}
</script>
Erklärung: location.href ist immer der ganze Pfad. du kannst also entweder überprüfen, ob top.location.href!='http://pfad/seite' oder nachsehen, ob die Seite im String vorkommt (indexOf()).

In der Framedatei:
Code:
<html>
<head>
<script>
function setUrl(){
	var param=document.location.search;
	if(param != ""){
 		//das ? am Anfang entfernen:
		param=param.substring(1,param.length);
		document.getElementById('inhalt').src = param;
	}
}
</script>
</head>
<frameset cols="20%,80%" onload="setUrl()">
  <frame name="menue" src="menue.html"></frame>
  <frame name="inhalt" src="inhalt.html" id="inhalt"></frame>
</frameset>
</html>
Der Inhaltsfrrame hat noch die id "inhalt" bekommen, und ich sprech das ganze mit getElementById() und .src an.
Ich hab' das ganze in eine eigene Funktion gesteckt, die aufgerufen wird, wenn die Seite fertig geladen ist (onload). Aus irgendeinem Grund hat's anders nicht funktioniert.

Jak
____________________________________
Join the DNRC | Godwin\'s Law (thx@stona)
Documentation is like sex: If it\'s good, it\'s very, very good. If it\'s bad, it\'s better than nothing.
\"In theory, theory and practice are the same. In practice, they are not\" (Lawrence Berra)
jak ist offline   Mit Zitat antworten