ie中的window模式窗口

来源:互联网 发布:java ssm框架 编辑:程序博客网 时间:2024/05/22 14:10

showModalDialog Method

Internet Development Index

Creates a modal dialog box that displays the specified HTML document.

Syntax

vReturnValue = window.showModalDialog(sURL [, vArguments] [, sFeatures])

Parameters

sURLRequired. String that specifies the URL of the document to load and display.vArgumentsOptional. Variant that specifies the arguments to use when displaying the document. Use this parameter to pass a value of any type, including an array of values. The dialog box can extract the values passed by the caller from thedialogArguments property of the window object.sFeaturesOptional. String that specifies the window ornaments for the dialog box, using one or more of the following semicolon-delimited values:dialogHeight:sHeightSets the height of the dialog window (see Remarks for default unit of measure).dialogLeft:sXPosSets the left position of the dialog window relative to the upper-left corner of the desktop.dialogTop:sYPosSets the top position of the dialog window relative to the upper-left corner of the desktop.dialogWidth:sWidthSets the width of the dialog window (see Remarks for default unit of measure).center:{ yes | no | 1 | 0 | on | off }Specifies whether to center the dialog window within the desktop. The default isyes.dialogHide:{ yes | no | 1 | 0 | on | off }Specifies whether the dialog window is hidden when printing or using print preview. This feature is only available when a dialog box is opened from a trusted application. The default isno.edge:{ sunken | raised }Specifies the edge style of the dialog window. The default is raised.help:{ yes | no | 1 | 0 | on | off }Specifies whether the dialog window displays the context-sensitive Help icon. The default isyes.resizable:{ yes | no | 1 | 0 | on | off }Specifies whether the dialog window has fixed dimensions. The default is no.scroll:{ yes | no | 1 | 0 | on | off }Specifies whether the dialog window displays scrollbars. The default is yes.status:{ yes | no | 1 | 0 | on | off }Specifies whether the dialog window displays a status bar. The default is yes for untrusted dialog windows and no for trusted dialog windows.unadorned:{ yes | no | 1 | 0 | on | off }Specifies whether the dialog window displays the border window chrome. This feature is only available when a dialog box is opened from a trusted application. The default isno.

Return Value

Variant. Returns the value of the returnValue property as set by the window of the document specified insURL.

 

window的模式窗口以前不常使用,总觉得它的功能不是很完整,而且是ie特有的一个东西,对于使用有一些反感心理,但在有些情况下似乎也没有更好的解决办法,例如在一个控件之上弹出一个对话框,虽然有各种各样的弹出组件与方式,大部分在控制之上是出不来的,即使使用iframe垫片技术,在拖动的时候的效果总是令人不那么满意

Internet Explorer Using Feature Control Registry Settings with Security Zone Settings

What do Feature Control Registry Settings and Security Zone Settings do?

Feature Control registry settings are provided in Windows XP SP 2 so that a specific process can be configured to opt-in to a particular security feature. In the following example, Internet Explorer has been configured to use the Windows Restrictions security feature(WRSF):

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft
\Internet Explorer\Main\FeatureControl
\FEATURE_WINDOWS_RESTRICTIONS] iexplore.exe=1

Once a process has been configured to use a security feature, the security feature is running and security zone settings can be applied for more precision, if implemented for that feature. In theSecurity Settings tab of Internet Options, the user can adjust these settings for many of the new Windows XP SP2 feature controls. If you selectEnable, it lowers the security settings and allows the behavior to run less securely, or in the same manner as it did in Windows XP Service Pack 1. For example, if Windows Restriction is set toEnable in the Intranet zone, Windows Restrictions will not be applied — script-initiated windows can be opened as freely as in Windows XP SP1. The Windows XP SP2 restrictions can be applied again by setting the security zone setting to Disable, which blocks the less-secure behavior while the feature control is enabled for that process.

For example, if the feature is turned on for Windows Restrictions, this feature:

Forces the status bar to be present in script-initiated Internet Explorer windows with the title bar [those that were created with window.open()].

Constrains the size and positioning of script-initiated Internet Explorer windows that have title and status bars to ensure that the title bar and the status bar in these windows is always visible to the user.

        我特意将关键的话语加粗变红,原来这是Windows XP SP2的新安全特性Windows Restrictions security feature(WRSF),为了安全,SP2特意强制将弹出的标题栏和状态栏都显示,让浏览者知道自己正在访问哪个地址哪个网页,防止恶意欺骗。此特性对Internet区域有效,而对本地的Intramet区域无效,就是说在XP SP2下使用代码status=no控制窗口无状态栏已经无效了。解决方法除了上述的修改客户端注册表键值关闭WRSF特性,或者还有一种解决方法就是在客户端上将系统的站点地址加入IE属性“安全”选项中的“本地Intranet”区域。不过这样好像就失去了B/S系统的最大优点,客户端这么多,不可能要求每个使用系统的人都这样设置,所以只能继续让状态栏显示。