using top.frames

wxdqz

New Member
Hy everybody!

I am trying to obtain in JavaScript the location information for a frame.
Actually, I have on my site a page that contains two frames as follows:

<html>
<frameset rows="80,*" border="0" frameborder="0" framespacing="0">
<frame src=http://www.webdeveloper.com/forum/archive/index.php/"http://mysite/mypage.htm" noresize scrolling=no name="home">
<frame src="http://www.google.com" scrolling=auto name="search">
</frameset>
</html>

I am trying to get access to the second frame (named search) - which contains a page located on a diffrent host - from the page displayed in the first frame (named home) which is on may host.
The source of mypage.htm is as follows:
<html>
<body>
<input type=button onclick="alert(parent.frames[1].location.href);" value="second frame location">
</body>
</html>

I can't succeed! The error message is "Access is denied".

If both of the pages are on the same host everything is ok!

All I want is to be able to obtain the location of the second frame.

Can enyone please explain to me why do I get the error? Is there a solution ?

Liana
 
Back
Top