<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怎么能够获取外部框架内容!
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怎么能够获取外部框架内容!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货