Faire communiquer 2 frames d'un frameset
Bonjour,
je doit travailler sur une vieille applis qui est gérée avec des frames et je n'arrive pas à faire communiquer ces frames entre elle.
Voici un exemple très simpliste : j'eesay d'appeler une fonction définie dans la frame a1 à partir de la frame a2
Page Mère :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| <html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="61,*" frameborder="NO" border="0" framespacing="0" cols="*">
<frame id="p1" name="p1" scrolling="NO" noresize src="a1.php" frameborder="YES" marginwidth="0" marginheight="0" >
<frame id="p2" name="p2" frameborder="YES" marginwidth="0" marginheight="0" src="a2.php">
</frameset>
<noframes>
<body>
</body>
</noframes>
</html> |
page a1.php :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| <html>
<head>
<title></title>
<script>
function a(){
alert("IT'S ALIVE !!!");
}
</script>
</head>
<body>
<h1 id="titre1">FRAME 1</h1>
</body>
</html> |
page a2.php :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| <html>
<head>
<script>
function test(){
parent.p2.a(); // Marche pas ! :-(
}
</script>
</head>
<body>
<h1 id="titre2">FRAME 2</h1>
<input type="button" value="test" onclick="test()" />
</body>
</html> |
Quelqu'un pourrait-il m'aider à faire fonctionner la fonction test() s'il vous plait ?