Fenster übergeordnete Attribut
Definition und Verwendung
Eltern-Eigenschaft gibt das übergeordnete Fenster des aktuellen Fensters.
Grammatik
window.parent
Browser-Unterstützung
Alle gängigen Browser unterstützen Eltern Attribute
Beispiele
Beispiele
Wenn Sie ein neues Fenster zu öffnen, Warnung das übergeordnete Fenster Pop-up:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "UTF-8">
<Titel> Dieses Tutorial (w3big.com) </ title>
</ Head>
<Head>
<Script>
Funktion openwin () {
window.open ( '', '', 'width = 200, height = 100');
alert (window.parent.location);
}
</ Script>
</ Head>
<Body>
<Input type = "button" value = "open window" Onclick = "openwin ()">
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "UTF-8">
<Titel> Dieses Tutorial (w3big.com) </ title>
</ Head>
<Head>
<Script>
Funktion openwin () {
window.open ( '', '', 'width = 200, height = 100');
alert (window.parent.location);
}
</ Script>
</ Head>
<Body>
<Input type = "button" value = "open window" Onclick = "openwin ()">
</ Body>
</ Html>
Versuchen »
window - Objekt