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

推荐订阅源

博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Engineering at Meta
Engineering at Meta
B
Blog
博客园_首页
量子位
博客园 - 叶小钗
L
LangChain Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
D
DataBreaches.Net
雷峰网
雷峰网
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
I
Intezer
H
Help Net Security
The Hacker News
The Hacker News
The Register - Security
The Register - Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
AWS News Blog
AWS News Blog
V
V2EX
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
Spread Privacy
Spread Privacy
A
Arctic Wolf
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
Schneier on Security
Schneier on Security
C
CERT Recently Published Vulnerability Notes
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Last Watchdog
The Last Watchdog
Latest news
Latest news
T
Troy Hunt's Blog
L
LINUX DO - 热门话题

博客园 - 小柯

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');