Hi,
I am trying to do something like this.
testMainFrame.htm
--------------------
<html>
<script>
function changeSrc()
{
window.frames["myFrame"].location.href = "testImage.htm"; // This gives
me an access denied error
}
</script>
<body>
<iframe name="mainFrame" id="mainFrame" src="testFrame.htm" statusbar="yes"
width=600 height=600> </iframe>
<p><input type=button value="Change source" onclick="changeSrc();">
</body>
</html>
testFrame.htm
--------------
<body>
<iframe name="myFrame" id="myFrame" width=500 height=500 src=""> </iframe>
<p>
<input type=button value="Change source" onclick="changeSrc();">
</body>
testImage.htm
--------------
<html>
<body marginwidth=0 marginheight=0>
<img src="/images/img_loading.gif"></img>
</body>
</html>
Could someone please help.
Regards,
Guru
Harikrishnan - 31 Mar 2005 17:33 GMT
The following code worked for me.. Please try this and let us know.
------------------------------------------------------------------------------
testMainFrame.htm
--------------------
<html>
<script language="JavaScript">
function changeSrc()
{
window.frames["mainFrame"].location.href = "testImage.htm"; // This
worked for me
}
</script>
<body>
<iframe name="mainFrame" id="mainFrame" src="testFrame.htm" statusbar="yes"
width=600 height=600> </iframe>
<p><input type=button value="Change source1" onclick="changeSrc();">
</body>
</html>
testFrame.htm
--------------
<html>
<script language="JavaScript">
function changeSrc()
{
window.frames["myFrame"].location.href = "testImage.htm"; // This gives
me an access denied error
}
</script>
<body>
<iframe name="myFrame" id="myFrame" width=500 height=500 src=""> </iframe>
<p>
<input type=button value="Change source2" onclick="changeSrc();">
</body>
</html>
testImage.htm
--------------
<html>
<body marginwidth=0 marginheight=0>
<img src="/images/img_loading.gif"></img>
</body>
</html>
------------------------------------------------------------------------------
Thanks
Hari
> Hi,
>
[quoted text clipped - 39 lines]
> Regards,
> Guru