IE和iframe [英] IE and iframe

查看:73
本文介绍了IE和iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我从父文件中调用iframe。在父文档中,

我使用以下脚本来获取iframe中存在的文本字段的值

。这似乎不适用于IE。


请指教。

window.frames [''myframe'']。document.getElementsByName(' 'mytextfield'')[0] .value


感谢您的帮助,

Dev。

解决方案

ka ********** @ gmail。 com escreveu:


我从父文档调用iframe。在父文档中,

我使用以下脚本来获取iframe中存在的文本字段的值

。这似乎不适用于IE浏览器。


请指教。


window.frames [''myframe'']。 .getElementsByName(''mytextfield'')[0] .value



< iframedoesn'的行为不像< frame>,所以你不会找到你的

< iframeinside" window.frames"收藏。


使用getElementById抓住你的< iframeby ^^

-

Jonas Raoni Soares Silva
< a rel =nofollowhref =http://www.jsfromhell.comtarget =_ blank> http://www.jsfromhell.com


Jonas Raoni写道:

ka ****** ****@gmail.com escreveu:


>我从父文档调用iframe。在
父文档中,我使用以下脚本来获取iframe中存在的文本字段的
值。这似乎不适用于IE。

请指教。

window.frames [''myframe'']。document.getElementsByName(' 'mytextfield'')
[0] .value



< iframedoesn'的行为不像< frame>,所以你不会找到你的

< iframeinside" window.frames"采集。



您可以通过

global - frames - 集合,整数​​索引和NAME属性引用IFRAME中包含的窗口对象< IE中的
(但不是ID属性)。


使用getElementById抓取你的< iframeby ^^



对IFRAME元素的引用与对IFRAME中包含的

全局/窗口对象的引用不同。


Richard。


ka ****** **** @gmail.com 写道:





我打电话给iframe来自我的父文件。在父文档中,

我使用以下脚本来获取iframe中存在的文本字段的值

。这似乎不适用于IE浏览器。


请指教。


window.frames [''myframe'']。 .getElementsByName(''mytextfield'')[0] .value


感谢您的帮助,

Dev。



getElementsByName在任何标准中都不存在。所以,如果我是你,我就不会使用那个




另请注意,如果iframe由另一个(子)域提供,它会

被认为是跨站点脚本,几乎总是被阻止。


-

Martijn Saly


Hi,

I am calling an iframe from my parent document. In the parent document,
i used the following script to get the value of the textfield present
in the iframe. This doesn''t seem to work in IE.

Please advise.
window.frames[''myframe''].document.getElementsByName(''mytextfield'')[0].value

Thanks for your help,
Dev.

解决方案

ka**********@gmail.com escreveu:

I am calling an iframe from my parent document. In the parent document,
i used the following script to get the value of the textfield present
in the iframe. This doesn''t seem to work in IE.

Please advise.

window.frames[''myframe''].document.getElementsByName(''mytextfield'')[0].value

<iframedoesn''t behave like the <frame>, so you won''t find your
<iframeinside the "window.frames" collection.

Grab your <iframeby using getElementById ^^
--
Jonas Raoni Soares Silva
http://www.jsfromhell.com


Jonas Raoni wrote:

ka**********@gmail.com escreveu:

>I am calling an iframe from my parent document. In the
parent document, i used the following script to get the
value of the textfield present in the iframe. This doesn''t
seem to work in IE.

Please advise.

window.frames[''myframe''].document.getElementsByName(''mytextfield'')
[0].value


<iframedoesn''t behave like the <frame>, so you won''t find your
<iframeinside the "window.frames" collection.

You can reference the window object contained in an IFRAME through the
global - frames - collection, by integer index and by NAME attribute
(but not by ID attribute) in IE.

Grab your <iframeby using getElementById ^^

A reference to an IFRAME element is not the same as a reference to the
global/window object contained in the IFRAME.

Richard.


ka**********@gmail.com wrote:

Hi,

I am calling an iframe from my parent document. In the parent document,
i used the following script to get the value of the textfield present
in the iframe. This doesn''t seem to work in IE.

Please advise.
window.frames[''myframe''].document.getElementsByName(''mytextfield'')[0].value

Thanks for your help,
Dev.

getElementsByName doesn''t exist in any standard. So I wouldn''t use that
if I were you.

Also note that if the iframe is served by another (sub)domain, it would
be considered cross-site scripting, which is almost always blocked.

--
Martijn Saly


这篇关于IE和iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆