Elternform erhält Iframe
Fenster.Iframeid
Iframe erhält das übergeordnete Fenster
Fenster.Parent
Parent.html
Die Codekopie lautet wie folgt:
<! DocType html public "-// w3c // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<kopf>
<meta http-äquiv = "content-type" content = "text/html; charset = utf-8">
<title> Titel hier einfügen </title>
<script type = "text/javaScript">
Funktion btnfn () {
window.subwin.test ();
}
Funktion get (Name) {
return document.getElementById (Name);
}
</script>
</head>
<body>
<Eingabe -ID = "Name" type = "text" value = "222">
<input type = "button" id = "btn" value = "klicken" onclick = "btnfn ();"> <br/>
<br/> <br/>
<iframe src = "sub.html" id = "subwin"
name = "subwin" marginwidth = "0"
marginHeight = "0" scrolling = "yes" Framborder = "0" Valign = "Middle"
resize = "no" style = "display: block; border: 3px fest rot;"> </iframe>
</body>
</html>
sub.html
Die Codekopie lautet wie folgt:
<! DocType html public "-// w3c // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<kopf>
<meta http-äquiv = "content-type" content = "text/html; charset = utf-8">
<title> Titel hier einfügen </title>
<script type = "text/javaScript">
Funktionstest () {
alert (window.parent.get ("name"). Wert); // Ergebnis: 222
}
</script>
</head>
<body>
Ich bin der Inhalt der Form
</body>
</html>