atribut induk jendela
Definisi dan Penggunaan
properti orangtua mengembalikan jendela induk dari jendela saat.
tatabahasa
window.parent
Dukungan Browser
Semua browser utama mendukung atribut orangtua
contoh
contoh
Ketika Anda membuka jendela baru, peringatan orangtua jendela pop-up:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
</ Kepala>
<Head>
<Script>
berfungsi openWin () {
window.open ( '', '', 'width = 200, height = 100');
alert (window.parent.location);
}
</ Script>
</ Kepala>
<Body>
<Input type = "button" value = "membuka jendela" onclick = "openWin ()">
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
</ Kepala>
<Head>
<Script>
berfungsi openWin () {
window.open ( '', '', 'width = 200, height = 100');
alert (window.parent.location);
}
</ Script>
</ Kepala>
<Body>
<Input type = "button" value = "membuka jendela" onclick = "openWin ()">
</ Body>
</ Html>
Coba »
objek jendela