王朝百科
分享
 
 
 

showModelessDialog

王朝百科·作者佚名  2012-04-15  
宽屏版  字体: |||超大  

showModelessDialog创建一个非模态对话框,显示指定的HTML/PHP/ASP等类型文件。

基本介绍showModelessDialog() (IE 5+ 支持)

window.showModelessDialog() 方法用来创建一个显示HTML内容的非模态对话框。

使用方法vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])[1]

使用实例:(两个文件放在同一个目录下)

1 . showModelessDialogEX.htm 文件代码:

<head>

<html>

<head>

<title>showModelessDialogEX.htm</title>

<script>

var sUserName="";

/*------------------------------------------------------------

Supplying the window object as a parameter allows for declaring the global

variable, sUserName, and using it to return information from the modeless

dialog box.

------------------------------------------------------------- */

function fnCallDialog()

{

showModelessDialog("myDialog.htm",window,"status:false;dialogWidth:300px;dialogHeight:300px");

}

/*-------------------------------------------------------------

The fnUpdate function takes the value passed into sUserName in myDialog.htm

to update the span text on this page. This function is called in both

fnGetInfo and fnCancel functions in myDialog.htm.

-------------------------------------------------------------*/

function fnUpdate()

{

oName.innerText = sUserName;

}

</script>

</head>

<body>

<p>Enter your first name: <span id="oName"

style="color:red;font-size:24">Joan</span></p> <input type="button"

value="Display Modeless Dialog" onclick="fnCallDialog()">

</body>

</html>

2 . myDialog.htm文件代码:

<html>

<head>

<title>myDialog.htm</title>

<script>

/* -------------------------------------------------------------

This function makes use of the dialogArguments property of the

window object. dialogArguments allows the global variable sUserName

to feed the value supplied to the input in this dialog box back to

the window that called it.

---------------------------------------------------------------- */

function fnGetInfo()

{

var sData = dialogArguments;

sData.sUserName = oEnterName.value;

sData.fnUpdate();

}

/* -------------------------------------------------------------

This function cleans up in case the user has clicked the

Apply button before canceling.

---------------------------------------------------------------- */

function fnCancel()

{

var sData = dialogArguments;

sData.sUserName = "Joan";

sData.fnUpdate();

}

</script>

</head>

<body>

<label FOR="oEnterName" accesskey="f">Enter your

<span style="text-decoration:underline">F</span>irst Name</label>

<input id=oEnterName><br><br>

<input value="Apply" type=button onclick="fnGetInfo();">

<input value="Ok" type=button onclick="fnGetInfo();window.close();">

<input value="Cancel" type=button onclick="fnCancel();window.close();">

</body>

</html>

参数说明sURL -- 必选参数,类型:字符串。用来指定对话框要显示的文档的URL。

vArguments -- 可选参数,类型:变体。用来向对话框传递参数。传递的参数类型不限,包括数组等。对话框通过window.dialogArguments来取得传递进来的参数。

sFeatures -- 可选参数,类型:字符串。用来描述对话框的外观等信息,可以使用以下的一个或几个,用分号“;”隔开。可选字符串dialogHeight:sHeight

可选字符串,指定对话框窗口的修饰,使用与一个或多个值以下分号分隔:

dialogHeight:sHeight

设置对话框窗口的高度(见备注默认度量单位)。

dialogLeft:sXPos dialogLeft: sXPos

设置对话框窗口相对于桌面左上角的左侧位置。

dialogTop:sYPos dialogTop:sYPos

设置对话框窗口相对于桌面左上角的榜首位置。

dialogWidth:sWidth dialogWidth:sWidth

设置对话框窗口的宽度(见备注默认度量单位)。

center:{ yes | no | 1 | 0 | on | off }

中心指定是否要在桌面对话窗口。 默认为 yes。

dialogHide:{ yes | no | 1 | 0 | on | off }

指定对话框窗口是否隐藏在打印或使用打印预览。此功能只有当一个对话框是从信任的应用程序打开。默认是no。

edge:{ sunken | raised }

指定对话框窗口边缘风格。默认是raised 。

resizable:{ yes | no | 1 | 0 | on | off }

指定对话框窗口中是否有固定的尺寸.默认是no。

scroll:{ yes | no | 1 | 0 | on | off }

指定对话框窗口是否显示滚动条。默认为 yes。

status:{ yes | no | 1 | 0 | on | off }

指定对话框窗口是否显示状态栏。默认为yes不受信任的对话窗口和窗口不信任的对话。

unadorned:{ yes | no | 1 | 0 | on | off }

指定对话框窗口是否显示边框的窗口浏览器。此功能只有当一个对话框是从信任的应用程序打开。默认是no。

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
如何用java替换看不见的字符比如零宽空格&#8203;十六进制U+200B
 干货   2023-09-10
网页字号不能单数吗,网页字体大小为什么一般都是偶数
 干货   2023-09-06
java.lang.ArrayIndexOutOfBoundsException: 4096
 干货   2023-09-06
Noto Sans CJK SC字体下载地址
 干货   2023-08-30
window.navigator和navigator的区别是什么?
 干货   2023-08-23
js获取referer、useragent、浏览器语言
 干货   2023-08-23
oscache遇到404时会不会缓存?
 干货   2023-08-23
linux下用rm -rf *删除大量文件太慢怎么解决?
 干货   2023-08-08
刀郎新歌破世界纪录!
 娱乐   2023-08-01
js实现放大缩小页面
 干货   2023-07-31
生成式人工智能服务管理暂行办法
 百态   2023-07-31
英语学习:过去完成时The Past Perfect Tense举例说明
 干货   2023-07-31
Mysql常用sql命令语句整理
 干货   2023-07-30
科学家复活了46000年前的虫子
 探索   2023-07-29
英语学习:过去进行时The Past Continuous Tense举例说明
 干货   2023-07-28
meta name="applicable-device"告知页面适合哪种终端设备:PC端、移动端还是自适应
 干货   2023-07-28
只用css如何实现打字机特效?
 百态   2023-07-15
css怎么实现上下滚动
 干货   2023-06-28
canvas怎么画一个三角形?
 干货   2023-06-28
canvas怎么画一个椭圆形?
 干货   2023-06-28
canvas怎么画一个圆形?
 干货   2023-06-28
canvas怎么画一个正方形?
 干货   2023-06-28
中国河南省郑州市金水区蜘蛛爬虫ip大全
 干货   2023-06-22
javascript简易动态时间代码
 干货   2023-06-20
感谢员工的付出和激励的话怎么说?
 干货   2023-06-18
 
>>返回首页<<
 
 
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
© 2005- 王朝网络 版权所有