1.前言
要打开一个可以载入页面的子窗口有三种方法,分别是
- window.open()
- window.showModalDialog()
- window.showModelessDialog()
open方法就是打开一个页面,可以说同用url链接打开一个页面一样,不推荐使用,因为很多浏览器会拦截。这里推荐使用的是window.showModalDialog和window.showModelessDialog。
2.showModalDialog和showModelessDialog的使用方法
语法:
vReturnValue = window.showModalDialog(sURL [, vArguments][,sFeatures])
vReturnValue = window.showModelessDialog(sURL [,vArgument][,sFeatures])
参数说明:
sURL--
必选参数,类型:字符串。用来指定对话框要显示的文档的URL。
vArguments--
可选参数,类型:变体。用来向对话框传递参数。传递的参数类型不限,包括数组等。对话框通过window.dialogArguments来取得传递进来的参数。
sFeatures--
可选参数,类型:字符串。用来描述对话框的外观等信息,可以使用以下的一个或几个,用分号“;”隔开。
3.showModalDialog和showModelessDialog的区别
showModalDialog:被打开后就会
始终保持输入焦点,除非对话框被关闭,否则用户无法切换到父窗口,类似alert的运行效果。
showModelessDialog:被打开后,用户
可以随机切换输入焦点。对主窗口没有任何影响,最多是被挡住一下而以。
分享到:
相关推荐
NULL 博文链接:https://shawnfree.iteye.com/blog/598885
window.showModalDialog以及window.open用法简介
window.showModalDialog以及window.open用法简介
ShowModalDialog函数的功能: 使用方法: 参数说明:
showModalDialog和window.open
本文实例讲述了js的window.showModalDialog及window.open用法。分享给大家供大家参考。具体分析如下: 一、window.open()支持环境: JavaScript1.0+/JScript1.0+/Nav2+/IE3+/Opera3+ 二、基本语法: window.open...
This is a `window.showModalDialog()` shim using a modal HTML5 `<dialog>` element and ECMAScript 6 Generators. It was tested in the latest Google Chrome with the *Enable Experimental JavaScript* flag ...
window.open()和window.showModalDialog(),并解决了showModalDialog()弹出窗口中列表分页的问题。 提供了三个JS方法: (1)showWindow(sURL, width, height); (2)showWindowInPage(pageUrl, params, title, ...
1> window.showModalDialog()采用JS原理实现,同时父窗口不可操作,window.open()采用新创建一个窗口,同时父窗口可操作; 2> 父窗口与子窗口传递值的方式也有所不同,在子窗口中操作父窗口也语法也不同,分别为var...
window.showModalDialog&&open.docx
window.open 函数的操作 取出showModalDialog中传过来的数据对象 request.getParameterMap()相关的操作实例
针对window.showmodaldialog弹出窗体无刷新的详细使用
javascript代码模块之\Window.ShowModalDialog使用手册
window.showModalDialog的基本用法
使用window.showModalDialog的程序员都知道,该方法可返回值。但是如果遇到跨域时,就返回为underfine。本文档通过iframe镶嵌页面解决该问题。
主页面用window.showModalDialog的时候,如果直接打开其它系统的页面,这时候别人的页面在window.returnValue=1;这样返回值的时候,主页面是取不到返回值的,原因就是因为跨域了.
javascript代码模块之window.showModalDialog方法的使用