FireFox 的父级 iframe 不起作用?
我正在尝试从 iframe 更改输入变量(位于父窗口或主窗口中)的值。它在 IE8、Chrome 或 Safari 中工作正常,但在 FireFox 中则不行...
这是我的代码:
parent.NameOfTheInputVariable.value=_value_;
我做错了什么?我读到 Firefox 不接受“父”窗口...我怎样才能访问主窗口?
I'm trying to change de value of an input variable (located in the parent or main window) from an iframe. It works fine in IE8, Chrome or Safari, but not in FireFox...
This is my code:
parent.NameOfTheInputVariable.value=_value_;
What am I doing wrong? I've read that firefox doesn't accept the "parent" window... how can I access the main window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题不在于
parent
,而是假设仅仅因为某个东西有一个名字就会有一个全局变量。这是 WebKit 采用的一种非标准 IEism(尽管我认为它可能只能在 Quirks 模式下工作,无论如何最好避免这种情况)。......应该完成这项工作。
The problem is not the
parent
, but assuming that there will be a global variable just because something has a name. That is a non-standard IEism that WebKit has adopted (although I think it may only work in Quirks mode, which is best avoided anyway).… should do the job.