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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
PCI Perspectives
PCI Perspectives
Webroot Blog
Webroot Blog
罗磊的独立博客
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Last Week in AI
Last Week in AI
美团技术团队
Help Net Security
Help Net Security
The Hacker News
The Hacker News
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
The Register - Security
The Register - Security
IT之家
IT之家
WordPress大学
WordPress大学
Jina AI
Jina AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Help Net Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
NISL@THU
NISL@THU
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
B
Blog
T
Tenable Blog
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
S
Security Affairs
小众软件
小众软件
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
W
WeLiveSecurity
A
Arctic Wolf
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

博客园 - 小柯

Enterprise Library 4.1 Configuration的使用 C#模仿QQ截图功能 asp.net 中 DropDownList 加入可输入功能解决方案 - 小柯 解决SQL Server Management Studio Express为英文的问题 Visual Studio 2008 简体中文正式版下载及序列号(无使用期限限制,正式版) 程序人生--一个程序员对学弟学妹建议(转) .NET 换肤软件 IrisSkin 2.0 破解版下载及多款皮肤下载 (转)JavaScript常用判断函数(正则表达式版) C#中常用的经典文件操作方法 反编译工具Reflector下载(集成两个常用.net插件,FileGenerator和FileDisassembler) C#遍历指定目录的递归(完美改进版+完整程序源码) C#遍历目录树的递归 在ASP.NET中自动给URL加上超链接 ASP.NET 中 Cookie 的基本知识 ASP.NET2.0统计图表(转) ASP.NET获取IP及电脑名等信息的简单方法+通用类文件源码 (转)了解你的兵器---VS2005 快捷键 Asp.Net Ajax系列(二) 局部页面呈现(Partial-Page Rendering) Asp.net Ajax 系列(一) ----------用了再说
(转)JavaScript 弹出窗口总结
小柯 · 2007-08-11 · via 博客园 - 小柯

1: window.open
<!--
window.open('page.html', 'newwindow', 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
//写成一行
-->
参数解释:
window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;
height=100 窗口高度;
width=400 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值;
toolbar=no 是否显示工具栏,yes为显示;
menubar,scrollbars 表示菜单栏和滚动栏。
resizable=no 是否允许改变窗口大小,yes为允许;
location=no 是否显示地址栏,yes为允许;
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;

2: showModalDialog()、showModelessDialog()
(1) window.showModalDialog() 模态对话框
模态对话框始终有焦点(焦点不可移走,直到它关闭)。

(2) window.showModelessDialog() 非模态对话框
由于是对话框,因此它并没有一般用window.open()打开的窗口的所有属性。
不必用window.close()去关闭它,
当以非模态方式[IE5]打开时, 打开对话框的窗口仍可以进行其他的操作,
即对话框不总是最上面的焦点,当打开它的窗口URL改变时,它自动关闭。

(3) 使用方法如下:
 vReturnValue = window.showModalDialog(sURL [, vArguments] [, sFeatures])
 vReturnValue = window.showModelessDialog(sURL [, vArguments] [, sFeatures])
参数说明:
 sURL
 必选参数,类型:字符串。用来指定对话框要显示的文档的URL。
 vArguments
 可选参数,类型:变体。用来向对话框传递参数。传递的参数类型不限,包括数组等。
 对话框通过 window.dialogArguments 来获取传递进来的参数, 通过 window.returnValue 来进行回传参数。

 sFeatures
 可选参数,类型:字符串。用来描述对话框的外观等信息,可以使用以下的一个或几个,用分号“;”隔开。
 dialogHeight 对话框高度,不小于100px,IE4中dialogHeight 和 dialogWidth 默认的单位是em,而IE5中是px,为方便其见,在定义modal方式的对话框时,用px做单位。
 dialogWidth: 对话框宽度。
 dialogLeft: 距离桌面左的距离。
 dialogTop: 离桌面上的距离。
 center: {yes | no | 1 | 0 }:窗口是否居中,默认yes,但仍可以指定高度和宽度。
 help: {yes | no | 1 | 0 }:是否显示帮助按钮,默认yes。
 resizable: {yes | no | 1 | 0 } [IE5+]:是否可被改变大小。默认no。
 status: {yes | no | 1 | 0 } [IE5+]:是否显示状态栏。默认为yes[ Modeless]或no[Modal]。
 scroll:{ yes | no | 1 | 0 | on | off }:指明对话框是否显示滚动条。默认为yes。

  还有几个属性是用在HTA中的,在一般的网页中一般不使用。
 dialogHide:{ yes | no | 1 | 0 | on | off }:在打印或者打印预览时对话框是否隐藏。默认为no。
 edge:{ sunken | raised }:指明对话框的边框样式。默认为raised。
 unadorned:{ yes | no | 1 | 0 | on | off }:默认为no。

3. 父窗口刷新问题
(1) 用window.open()打开的窗口
 window.opener.location.reload();
 
(2) 用showModalDialog()打开的窗口
 window.parent.dialogArguments.document.execCommand('Refresh');