I am new to DOM scripting, and I can not find documentation on this ... The following script never completes the getElementsByTagName("A") call if the "content" frame is loaded with a live site like
www.google.com or
www.dictionary.com, etc ... IF I take the same sites, and copy the source to a local file and then use that file in the frame, then the call works fine.
===== Page Follows =====>
<html><head><script type="text/javascript">
function filter()
{
var output = document.getElementById("output").contentDocument;
if( output ) { output.write( "output found<BR>\n" ); }
var content = document.getElementById("content").contentDocument;
if( content ) { output.write( "content found<BR>\n" ); }
var obj = content.getElementsByTagName("A");
output.write( "Tags Found!<BR>" );
for( var i=0;i<obj.length;i++)
{
output.write( "_<BR>" );
}
output.write( "Tags Iterated!<BR>" );
return 0;
}
</script></head><body>
<a onclick="filter();">filter</a>
<div id="out">
<iframe name="output" id="output" frameborder="2" height=100 width=100% scrolling=auto>
</iframe>
</div>
<div id="cntnt">
<iframe name="content" id="content" frameborder="0" src="http://www.google.com/" height=100% width=100% scrolling=auto>
</iframe>
</div>
</body></html>