Autor Beitrag
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 27.12.05 15:50 
Hallo,

ich habe (wieder'mal) ein Problem, auf das ich keine Antwort finden kann. Meine Seite hat als index.html ne Frameseite. Nun möchte ich aber auch 'nen "Direktlink" erstellen können. Dh: wenn ich jetzt www.fw.de/hallo.html aufrufe (per Link) wird logischer Weise nur diese html (also ohne Frameset) angezeigt. Ich möchte aber dass sich die Seite in dem Hauptframe meiner index.html öffnet. Was muss ich an der index.html verändern / bzw wie muss ich die Links "formulieren"?

Danke im Vorraus für die Hilfe

mfg
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Di 27.12.05 19:09 
Abend,
vielleicht kannste hiermit was basteln:
web tool box hat folgendes geschrieben:
Script für Browserfenster mit Frames
(für Anzeige im bestimmten Frame)

Wurde das Browserfenster mittels Frameset in mehrere Bereiche geteilt, können sie festlegen in welchem Frame die aufgerufene Datei angezeigt werden soll.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
<script type="text/javascript" language="JavaScript">
<!--
function ShowDocument(URL)
{
opener.parent.frames[x].location.href=URL;
return;
}
//-->
</script>




Für 'x' setzen sie die laufende Nummer des Frames ein.

Bitte beachten:

* Der erste Frame hat die Nummer 0
* Der zweite Frame hat die Nummer 1
* ...


Bye,
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 28.12.05 12:07 
wie ich das jetzte seh, geht das dann nur wenn ich das Script von einer meiner Seiten (die es kennen) aufrufen. Ich möchte aber jetzt zB hier n Lnk von ner Seite reinschreiben und diese soll dann im Hauptfranme meiner INdex.html geöffnet werden.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mi 28.12.05 14:27 
Hallo,

such mal nach "Frameset nachladen",
dann findest Du z.B. das:
Trickkiste - Frameset nachladen

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 28.12.05 16:40 
Danke! :D

Noch eine Frage: bei diesem Script:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
<script language="JavaScript">
<!--
var ZielDatei = "index.html?impressum.html";
if (!top.FramesetGeladen){
if(document.images)
top.location.replace(ZielDatei);
else
top.location.href = ZielDatei ;
}
//-->
  </script>
Muss ich für die Variable immer die Frameseite + "?"+ die zu ladende Datei angeben, das unterscheidet sich natürrlich von date zu datei also bei der impressum.html:
index.html?impressum.html
news.html:
index.html?news.html
usw.
Kann ich satt den Direkten namen auch sowas wie "self" schreiben, da der name der vareiert immer der Name der Datei ist indem sich das Script befindet.


mfg
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 29.12.05 12:37 
Hallo,

so: (nicht getestet)

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
<script language="JavaScript">  
<!--

pfad = self.location.href;
pos = pfad.lastIndexOf('/');
pfad = pfad.substring(pos+1,pfad.length);
  
var ZielDatei = "index.html?"+pfad;
if (!top.FramesetGeladen){  
if(document.images)  
top.location.replace(ZielDatei);  
else  
top.location.href = ZielDatei ;  
}  
//-->  
  </script>

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 29.12.05 13:29 
Irgendwie schwirrt mit was von document.name im Hinterkopf rum. Ginge das auch? Ich probier deinen Virschlag selbstverständlich aus ;-)
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 29.12.05 13:34 
user profile iconFabian W. hat folgendes geschrieben:
Irgendwie schwirrt mit was von document.name im Hinterkopf rum. Ginge das auch? Ich probier deinen Virschlag selbstverständlich aus ;-)


EDIT: Am besten waäre ne Funktion die mir den vollen Pfad der HTML zurückgibt also fabian.funpic/xx/xx.html


-> Verdammt, ich verwisch immer den falschen Button, kann einer den Beitrag oberhalb löschen?
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 29.12.05 15:32 
Hallo,

versuch es mal damit: self.location.pathname

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Fr 30.12.05 09:08 
Funzt. Danke! :D