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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - talantlee

C# Windows Form 下通过MethodInvoker 实现异步调用 (不使用thread) Web导出Excel时"0"自动消失的解决方案 - talantlee - 博客园 如何令web中的Select中实现Combox效果 - talantlee - 博客园 Sql Server 2005 新的分页存储过程的推荐写法 .NET 编译时出现LC.exe错误解决方法 C#中通过代码控制IIS服务重启 - talantlee - 博客园 Javascrip的給人忽略掉的循環寫法(FOR IN) CSS 一些语法规范以及写法(不涉及語法) 学习.NET技術的一些网站推荐 javascript 中面向對象編程 (類的繼承) (小技巧九) 【摘錄】Xml讀寫示例~ javascript MailTo 郵件技巧(小技巧八) - talantlee SQl2000數據同步技術入門級(DTS,Replication) javascript IE与FireFox 一些兼容写法 (小技巧七) javascript 彈出式窗體詳解 (小技巧六) 【文摘】让你受益匪浅的IT培训语录 javascript 中面向對象編程 (類的構造) (小技巧五) - talantlee 【文摘】设计模式:Model View Presenter 《文摘》伟大架构师的秘密
Web所有父窗体与子窗体的交互方法列举(子调用父窗体函数)
talantlee · 2009-01-12 · via 博客园 - talantlee

Posted on 2009-01-12 09:40  talantlee  阅读(1891)  评论()    收藏  举报

1>父窗体是使用window.open(url,name,feather)打开子窗体时,使用下面的方法获取。
调用父窗体函数:window.opener.Fun();
调用父窗体物件:window.opener.document.getElementById("txt_test").value
2>子窗体是IFrame的时候,直接用window.parent.Fun或window.parent.Obj

3>父窗体是使用window.showModalDialog(url,arguments,feather)打开子窗体时,使用下面的方法获取。
   1.体在Show子窗体的时候,把当前

window对象(只要对象的话用window.document即可)当参数传到子窗体:
      方法如:window.showModalDialog(url,window,"dialogwidth=300px;")
    2.窗体获取这个window对象.var pWin=window.dialogArguments;
    3.同过pWin来调用父窗体函数。(例如 父窗体函数为pFun()); 
 var pwin = window.dialogArguments;
 if(pwin!=undefined){
 var codeStr = "pFun();"
 pwin.execScript(codeStr,"javascript");

当然上面的方法直接等价于pWin.pFun()