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

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
月光博客
月光博客
Jina AI
Jina AI
F
Fortinet All Blogs
博客园 - 聂微东
The Cloudflare Blog
美团技术团队
B
Blog RSS Feed
N
Netflix TechBlog - Medium
罗磊的独立博客
The GitHub Blog
The GitHub Blog
I
InfoQ
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
阮一峰的网络日志
阮一峰的网络日志
V
V2EX

博客园 - bela liu

生成PDF文档,并在PDF文档结尾加印章 EF CodeFirst 学习 1 - 用fluent API设置元数据, silverlight: 关于dataform的commit silverlight:datagrid滚动 win7下chm打不开 MS DTC 无法正确处理DC升级/降级事件。MS DTC 将继续运行并使用现有的安全设置。 远程桌面如果超出最大连接数, 使用命令行mstsc /console登录即可。 windows server 2008 安装live mail windows server 2008 安装 MSN Help: DCOM中设定"launch permission"的问题 Qt 学习(1) 使用firefox的一个小技巧 - bela liu - 博客园 现有一车(千里马)过年从苏州回赣榆,15号或者17号出发,21号,23号或者25号返程。 在Oracle中申明与某个字段类型相同的变量 几道Python的习题 在ReportViewer中使用超链接(HyperLink) 未解之Bug (1) : 必须放在具有 runat=server 的窗体标记内 [转]面向对象与数据模型 在模式窗体中提交而不打开新窗体
在window.showModelessDialog打开的窗体中调用原窗体的alert...
bela liu · 2006-09-28 · via 博客园 - bela liu

以dialogArguments将window作为参数传递。

test_parent_win.htm:

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml" >
 3 <head>
 4     <title>无标题页</title>
 5     <script type="text/javascript">
 6     function openModelessWin()
 7     {
 8         var fs = 'dialogWidth:600px;dialogHeight:400px';
 9         var ret = window.showModelessDialog('test_child_win.htm', window, fs);
10         alert(ret); // 'here alert will make ie to death!'
11     }
12     function openModalWin()
13     {
14         var fs = 'dialogWidth:600px;dialogHeight:400px';
15         window.showModalDialog('test_child_win.htm', window, fs);
16     }
17     function doTest()
18     {
19         alert('go to hell!');
20     }
21     </script>
22 </head>
23 <body>
24 <input id="b1" type="button" value="openModelessWin" 
25     onclick="javascript:openModelessWin()" />
26 <input id="b2" type="button" value="openModalwin"
27     onclick="javascript:openModalWin()" />
28 </body>
29 </html>

test_child_win.htm:

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml" >
 3 <head>
 4     <title>无标题页</title>
 5     <script type="text/javascript">
 6     function callBackTest()
 7     {
 8         if (window.dialogArguments != null)
 9         {
10             var pwin = window.dialogArguments;
11             if (pwin.doTest != null)
12             {
13                 pwin.doTest();
14             }
15         }
16     }
17     </script>
18 </head>
19 <body>
20 <input id="b1" type="button" value="CallParentWindowMethod"
21     onclick="javascript:callBackTest()" />
22 </body>
23 </html>
24 

有时会死掉。