惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
P
Proofpoint News Feed
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
The Last Watchdog
The Last Watchdog
F
Fortinet All Blogs
S
Schneier on Security
Help Net Security
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
I
InfoQ
T
The Blog of Author Tim Ferriss
Cisco Talos Blog
Cisco Talos Blog
Stack Overflow Blog
Stack Overflow Blog
T
Troy Hunt's Blog
人人都是产品经理
人人都是产品经理
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
Forbes - Security
Forbes - Security
Vercel News
Vercel News
S
Security Affairs
美团技术团队
P
Privacy & Cybersecurity Law Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Spread Privacy
Spread Privacy
Attack and Defense Labs
Attack and Defense Labs
IT之家
IT之家
U
Unit 42
Recorded Future
Recorded Future
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
P
Palo Alto Networks Blog
H
Hacker News: Front Page
S
Security @ Cisco Blogs
博客园 - 【当耐特】

博客园 - riancy

XAMPP设置tomcat自启动时,报无效的Win32程序 Centos安装man功能 wmware 10 升级到11后,macos不能运行的问题 Android Sdk Manager更新 Android代码调试报错 可以用来求急的开源项目es5-shim PhoneGap3.2安装步骤 jQuery1.9.1针对checkbox的调整 WPF DataGrid 对行中单元格的访问 Eclipse+JBoss+Seam我实在难以忍受 [jQuery插件开发][dynamicTable2.0]根据JSON数据自动生成HTML Table 根据JSON数据,自动生成Table 从XmlDocument到XDocument的转换 Jquery插件Uploadify修改应用 Silverlight中的WatermarkedTextBox OutLook的网页版精美界面--修改版 永别了,Text与NText .Net Framework2.0内部版本问题引起的错误! 可以遗忘的HTML
frame间的层级调用,如何支持firefox
riancy · 2008-07-01 · via 博客园 - riancy

碰到这样的问题,
我有一个页面main.html,里面有很多的frame,比如说a.html,b.html,c.html,d.html,e.html。。。
这些子页面,里面都有一个同名javascript的MenuButtonClass()方法
在其中一个子页面中,我会处理其它的frame是,一般会这样写

window.parent.frames(x).MenuButtonClass();


这个代码在IE中是没有任何问题的,可是在firefox是错误的!

后来我这样写了

window.parent.document.getElementsByTagName("frame")[x].MenuButtonClass();


但是仍然错误,为什么?我调式了,发现
window.parent.document.getElementsByTagName("frame")[x]是有对象的
难道还没有其它的东西没写?

今天终于找到原因了,原来少个

contentWindow属性
所以上面应该这样写

window.parent.document.getElementsByTagName("frame")[x].contentWindow.MenuButtonClass();


这样的话,支持IE和firefox就没有问题了。
附上示例代码
窗体间访问的例子.rar