Well, it does work. Here's a top page (cal lit top.htm):
HTML Code:
<!DOCTYPE html>
<html>
<head>
<title>Top Page in Send to iframe Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function sendtonetworkframe() {
window.frames[0].sendtext(' a test to see it work');
}
</script>
</head>
<body>
<iframe src="network.htm" width="300" height="300" scrolling="auto" frameborder="1"></iframe><br>
<span onclick="sendtonetworkframe();" title="click me" style="cursor: pointer;">Test</span>
</body>
</html>
And here's network.htm:
HTML Code:
<!DOCTYPE html>
<html>
<head>
<title>'Network' Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function sendtext(text){
document.body.insertBefore(document.createTextNode(text), document.body.firstChild);
}
</script>
</head>
<body>
</body>
</html>
On the top page, click on Test and you will see the text appear on network.htm in the iframe.
To answer your other question, yes. If you have a reference to all of something on a page, like all of the divs, you have to iterate over it to get each one. But you can instead do what I have done in my example, supply the index if you know which it is and thereby skip the iteration process.
BTW, window.frames is not an HTML collection. It is a collection of the frames on the page, which are not HTML objects, rather references, each of which represents the window object for the page it contains.
About marking a thread resolved -
Go to your first post in the thread, hit:
Edit
Then in the lower right hit:
Go Advanced
Then in the top portion of the advanced editor "Your Message" section find the drop down for:
Prefix
Change it to Resolved.
Bookmarks