Object tag and Javascript access

liunx

Guest
Problem description:<br />
<br />
In my main page (a.htm) I have set a value to a javascript variable (flag).<br />
<br />
I have also created an object element of html type so that I can load an html document (b.htm) in it.<br />
<br />
<object type='text/html' border='0' style='position:absolute;z-index:2;top:50px;left:0px;width:100%;height:100%' data="b.htm" id='canvas'></object><br />
<br />
In the second page (b.htm) I want to be able to load that variable (flag). <br />
<br />
How do I do that ? I always get undefined error.<br />
<br />
So the question it, can I have access to the javascript code/variables of the page that object type=html is created in from within the page loaded in that object tag ? If so how ?<br />
<br />
I've tried everything I could possibly think of.<br />
<br />
Any help ?<br />
<br />
I am looking forward to receiving your reply.<br />
<br />
Best Regards to all<br />
<br />
I am attaching the code I've created:<br />
<br />
------- a.htm------<br />
<br />
<br />
<br />
<HTML><br />
<HEAD><br />
<TITLE>Example</TITLE><br />
<br />
<br />
<script type="text/javascript"><br />
<!--<br />
var flag="Readed and Rendered";<br />
<br />
document.write(flag)<br />
//--><br />
</script> <br />
</HEAD><br />
<br />
<BODY><br />
<br />
<object type='text/html' border='0' style='position:absolute;z-index:2;top:50px;left:0px;width:100%;height:100%' data="b.htm" id='canvas'></object><br />
<br />
<br />
</BODY><br />
</HTML><br />
<br />
<br />
--------b.htm-------<br />
<br />
<HTML><br />
<HEAD><br />
<TITLE>Popup Example</TITLE><br />
<br />
<BODY style="background:#666666;border:0px;overflow:hidden"><br />
<br />
<script type="text/javascript"><br />
<!--<br />
document.write(parent.flag)<br />
//--><br />
</script><br />
<br />
<br />
</font><br />
</BODY><br />
</HTML><br />
---------------------------------------<!--content-->this is a double-post.<br />
<br />
the javascript thread for this question is here:<br />
<br />
<!-- m --><a class="postlink" href="http://forums.webdeveloper.com/showthread.php?s=&threadid=7274">http://forums.webdeveloper.com/showthre ... eadid=7274</a><!-- m --><!--content-->
 
Back
Top