Forum Moderators: open
In my page, there are 2 frames. Second fram contain an externel url (eg. www.google.com). I want to get second frame's url from top fram. I used "parent.bottom.URL" but it returns "Undefined". Please help
Fram Main Page
<html>
<head>
<title>New Page 2</title>
</head>
<frameset rows="*,*">
<frame name="top" src="new_page_3.htm">
<frame name="bottom" src="http://www.google.com">
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
Fram Top Page (new_page_3.htm)
Code:
<html>
<head>
<title>New Page 3</title>
<script>
function showURL()
{
alert(parent.bottom.URL)
}
</script>
</head>
<body>
<form>
<input type="button" onclick="showURL()" value="Show URL">
</form></body>
</html>
If this were allowed, advertisers in framesets could sniff the next frame and see what data is being put in it, or even replace that frame with their ads. As long as the pages loaded in the frames are from the same server you should be able to manipulate those documents, just not external ones.