I have a web site of the frames. In one frame, there is a php code like this:



So it ends up having a variable with a numeric value.($i)
What I want to do and cant, is to get this value to be printed on the second frame through javascript, so the target frame wont be reloaded. I am also trying to have this javascript unrelated to button click, since probably I will add a third frame and from this third frame the php code will be activated. So it is like the javascript in the php frame should send the variable value to the target frame's javascript evertime page is reload.

I found the following example but dont know how to use it:

<button onclick="parent.frames[1].foo='bar'parent.frames[1].document.getElementById('text').innerHTML='Current value of the <em>foo</em> variable: ' + parent.frames[1].foo;">Write "Hello, World!" to the other frame.</button>

and in the target frame:

<script type="text/javascript">
var foo="<?php echo $_POST['bar']; ?>";
onload = function() { document.getElementById('text').innerHTML = "Current value of the <em>foo</em> variable: " + foo; }
<div id="text"></div>

Any ides?

Thanks in advance....

Have a nice day

Murat Isik