Bonjour,
J'ai tenté d'utiliser la fonction getIFramePlace pour faire passer une variable php d'un iframe à mon document principal, mais ça fonctionne pas. Quelqu'un pourrait-il indiquer où est l'erreur:

DANS MON DOCUMENT PRINCIPAL mondicumentprincipal.php

Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
<iframe src="monfichieriframe.php">
</iframe>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
document.write("<br><br>mavariablej est sur page principale: ");
var mavariablej =  document.getIFramePlace("monfichieriframe.php");
document.write(mavariablej);

DANS MON FICHIER IFRAME monfichieriframe.php

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
<?
$mavariable=10;
?>
<script language="javascript">
var mavariablej=<?echo $mavariable?>;
document.write("mavariablej est: ");
document.write(mavariablej);
</script>
Merci par avance.