Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Browsers / Internet Explorer / March 2005



Tip: Looking for answers? Try searching our database.

IFRAME src change Giving Access Denied

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gururaj - 18 Feb 2005 09:48 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.