attribut parent de fenêtre
Définition et utilisation
propriété parent renvoie la fenêtre parent de la fenêtre actuelle.
grammaire
window.parent
support du navigateur
Tous les principaux navigateurs prennent en charge les attributs parents
Exemples
Exemples
Lorsque vous ouvrez une nouvelle fenêtre, l'avertissement parent fenêtre pop-up:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
</ Head>
<Head>
<Script>
fonctionner openwin () {
window.open ( '', '', 'width = 200, height = 100');
alerte (window.parent.location);
}
</ Script>
</ Head>
<Body>
<Type = valeur d'entrée "bouton" = "fenêtre ouverte" onclick = "openwin ()">
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
</ Head>
<Head>
<Script>
fonctionner openwin () {
window.open ( '', '', 'width = 200, height = 100');
alerte (window.parent.location);
}
</ Script>
</ Head>
<Body>
<Type = valeur d'entrée "bouton" = "fenêtre ouverte" onclick = "openwin ()">
</ Body>
</ Html>
Essayez »
objet Window