O
oscar1martin
The property document.links seems to access links inside a frame, but
not an iframe. For instance, the following code displays a "4": 2
links in main page, 2 links in frame1.
<body onload="fn()">
<script type="text/javascript">
function fn()
{
alert(document.links.length)
}
</script>
<a href="http://somewhere1">aaa</a>
<a href="http://somewhere2">bbb</a>
<frameset>
<frame name="frame1" id="frame1">
<a href="http://somewhere3">ccc</a>
<a href="http://somewhere4">ddd</a>
</frame>
<iframe name="frame2" id="frame2" src="http://somewhere5">
</iframe>
</frameset>
</body>
Is there a way to access the links in the iframe?
Thanks in advance.
not an iframe. For instance, the following code displays a "4": 2
links in main page, 2 links in frame1.
<body onload="fn()">
<script type="text/javascript">
function fn()
{
alert(document.links.length)
}
</script>
<a href="http://somewhere1">aaa</a>
<a href="http://somewhere2">bbb</a>
<frameset>
<frame name="frame1" id="frame1">
<a href="http://somewhere3">ccc</a>
<a href="http://somewhere4">ddd</a>
</frame>
<iframe name="frame2" id="frame2" src="http://somewhere5">
</iframe>
</frameset>
</body>
Is there a way to access the links in the iframe?
Thanks in advance.