问题描述
我原本问这个,当时我正在抓住吸管。我创建了下面的小提琴,这与我在内部应用程序上看到的内容密切相关:
I orginally asked this question and at the time I was grasping at straws. I created the following fiddle that is closely related to what I'm actually seeing on my internal application:
有一个正常的index.asp页面。在该页面上,我可以打开一个包含iFrame的div(所以弹出窗口)。然后从iFrame,我可以打开另一个div,包括另一个iFrame。但是,当第二个div打开,我试图关闭第一个div。希望这是有道理的。
There is a normal index.asp page. On that page I can open a div that includes an iFrame (so a popup). Then from that iFrame I can then open another div that includes another iFrame. However, when the second div opens I am trying to close the 1st div. Hopefully that makes sense.
但是,当我尝试打开第二个div时,创建iframe的代码永远不会运行。我认为它与顶有关。这是目前在我的内部应用程序代码。当我尝试添加top.hidepopwin我得到一个错误在Firebug:
权限被拒绝访问属性hidePopWin
However, when I try to open the second div, the code to create the iframe never gets run. I think it has to do with the "top." that is currently in my internal application code. When I try to add top.hidepopwin I get an error in Firebug:Permission denied to access property 'hidePopWin'
,在我的代码内部我没有得到这个错误消息,但我不要进入doPopWin代码。
However, in my code internally I don't get that error message, but I don't get into the doPopWin code.
原因当我拿出顶部。在我的代码在内部它不工作的方式,我期望(我不能复制它在小提琴)。基本上,第二个div已创建,但仍保持相同的大小,而不是所有的元素都被清除(即原始菜单仍显示在新菜单下)。
Unfortunately for whatever reason when I take out the top. in my code internally it doesn't quite work the way I'm expecting (and I can't replicate it on the fiddle). Basically the second div gets created but it remains the same size and not all the elements are getting cleared (i.e the original menu is still showing up under the new menu).
任何人都有这个想法吗?小提琴看起来像我预期的工作,但这个顶。 。
Anyone have any idea's on this? The fiddle seems to be working as I expect but this "top." thing is kind of weird.
更新:
SLaks回答为什么最佳。不工作的jsFiddle是可以接受的。我仍然对这个问题仍有疑问:
SLaks answer of why the "top." doesn't work for jsFiddle is acceptable. I'm still left wondering about this issue:
不管什么原因,当我拿出了顶部。在我的代码在内部它不工作的方式,我期望(我不能复制它在小提琴)。基本上,第二个div已创建,但仍保持相同的大小,并且并非所有元素都已清除(即原始菜单仍显示在新菜单下)。
Unfortunately for whatever reason when I take out the top. in my code internally it doesn't quite work the way I'm expecting (and I can't replicate it on the fiddle). Basically the second div gets created but it remains the same size and not all the elements are getting cleared (i.e the original menu is still showing up under the new menu).
任何想法?
推荐答案
$ c>为寄存您的页面的最外层框架返回
窗口
对象。
在jsFiddle中, code> jsfiddle.com 页面,与用户代码位于不同的域中。 (用户提交的jsFiddle运行在 http://fiddle.jshell.net
)
In jsFiddle, that's the root jsfiddle.com
page, which is in a different domain than your user code. (user submissions in jsFiddle run in http://fiddle.jshell.net
)
这篇关于javascript iframe“top”。多个div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!