a.asp文件如下
<table WIDTH="778" border="0" CELLSPACING="0" CELLPADDING="0">
<tr>
<td width="778" height="74" ><iframe height="95" width="100%" name="head" src="home/head.asp" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" noresize></iframe></td>
</tr>
<tr>
<td width="778" height="600" valign="top"><iframe  width="100%" id="main" name="main" src="home/homemain.asp" scrolling="no" frameborder="0" marginwidth="0" marginheight="0"></iframe></td>
</tr>
<tr>
<td width="778"><iframe width="100%" name="bottom" src="home/bottom.asp" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" noresize></iframe></td>
</tr></table>
其中有一登录页面包含在里面,登陆成功后,b.aspx页面载入a.asp文件中的iframe
name="main" 的对象中,b.aspx想通过脚本window.parent.document.getElementById(window.name)访问a.asp中的iframe对象.在a.asp网页上显示拒绝访问,为什么呀?

解决方案 »

  1.   

    window.parent.document.getElementById(window.name)可以访问么? 是asp文件包含在aspx文件中?
      

  2.   

    我用alert(window.parent.document)跟踪的话,没有值
      

  3.   

    window.opener.document.getElementById("xxx")试试...
      

  4.   

    兄弟呀,alert(window.opener.document) 为空或不是对象哦
      

  5.   

    你描述的很乱,究竟谁在谁的里面?alert(window.parent.frames[window.name].document.getElementById("main").src)
      

  6.   

    alert(window.parent.frames[window.name].document.getElementById("main")) 为null
      

  7.   

    因为是这样的,有一个asp的网站,其中index.asp首页是由几个iframe组成,当登陆成功后,把一个虚拟目录下的b.aspx文件载入到index.asp的一个iframe里面,因为为了b.aspx在index.asp高度自动调整,所以我想通过window.parent.document.getElementById(window.name)访问index.asp里的iframe对象,可是跟踪alert(window.parent)的话什么都没有,在asp网页状态栏上显示拒绝访问.