<script language="javascript">
document.writeln('<frameset rows="34,*" name=forum_0   frameborder="NO" border="0" framespacing="0">')
document.writeln('<frame name="TopFrame" id="TopFrame" scrolling="NO" src="http://www.baidu.com">')
document.writeln('<frameset rows="*,100" name=forum  frameborder=0 framespacing="0" cols="*"> ')
document.writeln('<frame name="mainFrame" id="mainFrame" src="http://www.google.com" >')
document.writeln('<frame name="bottomFrame" id="bottomFrame" scrolling="no" src="">')
document.writeln('</frameset>')
document.writeln('</frameset>')

function xxx(){
alert(document.getElementById("TopFrame").contentWindow.document.getElementById("TopFrame"))
}
setTimeout("xxx()",2000)
</script>获取后会提示“错误:拒绝访问。”请问js怎么能够获取外部框架内容!