关于window.showModalDialog()返回值的学习
先介绍一个showModaldialog的基本用法
使用方法:
vReturnValue = window.showModalDialog(URL [, Arguments] [,Features])
参数说明:
URL--必选参数,类型:字符串。用来指定对话框要显示的文档的URL。
Arguments--可选参数,类型:变体。用来向对话框传递参数。传递的参数类型不限,包括数组等。对话框通过window.dialogArguments来取得传递进来的参数。
Features--可选参数,类型:字符串。用来描述对话框的外观等信息,可以使用以下的一个或几个,用分号“;”隔开。
1.dialogHeight :对话框高度.
2.dialogWidth: 对话框宽度。
3.dialogLeft: 离屏幕左的距离。
4.dialogTop: 离屏幕上的距离。
5.center: {yes | no | 1 | 0 }:窗口是否居中,默认yes,但仍可以指定高度和宽度。
6.help: {yes | no | 1 | 0 }:是否显示帮助按钮,默认yes。
7.resizable: {yes | no | 1 | 0 } [IE5+]:是否可被改变大小。默认no。
8.status: {yes | no | 1 | 0 } [IE5+]:是否显示状态栏。默认为yes[ Modeless]或no[Modal]。
9.scroll:{ yes | no | 1 | 0 | on | off }:指明对话框是否显示滚动条。默认为yes。
下面几个属性是用在HTA中的,在一般的网页中一般不使用。
10.dialogHide:{ yes | no | 1 | 0 | on | off }:在打印或者打印预览时对话框是否隐藏。默认为no。
11.edge:{ sunken | raised }:指明对话框的边框样式。默认为raised。
12.unadorned:{ yes | no | 1 | 0 | on | off }:默认为no。
下面主要就针对返回值的两个例子
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>无标题文档</title>
- <mce:script type="text/<a href="http://lib.csdn.net/base/18" class='replace_word' title="JavaScript知识库" target='_blank' style='color:#df3434; font-weight:bold;'>JavaScript</a>"><!--
- function oper()
- {
- var address=window.showModalDialog("return.html","aaaa","dialogWidth=400px;dialogHeight=200px");
- document.myform.txtReturnValue.value=address;
- }
- // --></mce:script>
- </head>
- <body>
- <form name="myform" method="post">
- <div>
- <div><input type="button" name="xxx" value="返回值" onclick="oper()" /><input type="text" name="txtReturnValue" /></div>
- </div>
- </form>
- </body>
- </html>
- <html>
- <head>
- <Title></Title>
- <mce:script type="text/javascript"><!--
- function returntest()
- {
- window.returnValue="我是返回值";
- window.close();
- }
- // --></mce:script>
- </head>
- <body>
- <form>
- <input type="button" onClick="returntest()" value="返回值"/>
- </form>
- <body>
- <html>
//----------------------------------------------------------------------------------------------------------------------
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head id="Head1" runat="server">
- <title>无标题页 </title>
- <mce:script type="text/javascript"><!--
- function btnClick()
- {
- var ret = window.showModalDialog("b.aspx");
- if (ret != null)
- {
- window.document.getElementById("TextBox1").value = ret[0];
- window.document.getElementById("TextBox2").value = ret[1];
- }
- return false;
- }
- // --></mce:script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
- <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
- <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return btnClick();" />
- </div>
- </form>
- </body>
- </html>
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head id="Head1" runat="server">
- <title>无标题页</title>
- <mce:script type="text/javascript"><!--
- function btnClick()
- {
- var ret = new Array(2);
- ret[0] = "aa";
- ret[1] = "bb";
- window.returnValue = ret;
- window.close();
- return false;
- }
- // --></mce:script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return btnClick()" />
- </div>
- </form>
- </body>
- </html>
关于window.showModalDialog()返回值的学习相关推荐
- window.open返回值实例详解(子窗口向父窗口回显)
window.open返回值实例详解(子窗口向父窗口回显) window.open实例: 1.父页面: <script language="javascript" type= ...
- window.open返回值
此篇文章转自:冰雪芯梦 内容直接拿过来.Mark下.很有用.感谢冰雪芯梦分享知识 最近在谷歌浏览器下发现一个问题,就是使用谷歌浏览器已经不兼容window.showModalDialog了,所以还是改 ...
- adb shell读取返回值_shell学习笔记03(函数amp;shell工具amp;面试题)
自定义函数 1.基本语法 [ function ] funname[()] {Action;[return int;] } funname 2.经验技巧 (1)必须在调用函数地方之前,先声明函数,sh ...
- 迪文屏幕T5UID3平台学习笔记二:变量图标显示和按键返回值按钮学习
需要实现一个功能:当点击某个按钮时候,要求能够改变按钮的字体和颜色,比如: 点击strat按钮后,显示stop,这样再点击就实现Stop逻辑,同时显示变成Start,也 就是说把Start和Stop按 ...
- matlab 调用子函数返回值,matlab学习笔记13_1 函数返回值
一起来学matlab-matlab学习笔记13函数 13_1 函数返回值 觉得有用的话,欢迎一起讨论相互学习~Follow Me 函数返回一个值 返回值不必使用return语句,而是直接将需要返回的变 ...
- select函数返回值_Vue学习笔记之函数、高阶函数、v-model的应用
一.哪些函数是响应式的: 1.push 在后面追加数据 5.sort() 排序 6.reverse() 顺序翻转 abcd ----> dcba 红框中的方式修改数组中的数据时,界面没有响应式的 ...
- java 内部类 返回值_Java学习笔记:形参和返回值、内部类、常用API
形参和返回值 类名作形参 public void useCat(Cat c){ c.eat(); } CatOperator co=new CatOperator(); Cat c=new Cat() ...
- keil5函数 默认返回值_python学习第12天----内置函数 - 我想对你说
1.内置函数 python解释器提供的,直接可以使用的函数,如print,input等 1)作业域相关 ①globals() 以字典的类型返回全部局部变量 ②locals() 以字典的类型返回当前 ...
- 前台技术--window.showModalDialog带来的浏览器兼容问题
双击域的实现:http://blog.csdn.net/gaopeng0071/article/details/21179619, 继此篇博文,讲述的双击域实现,在后续发现使用window.showM ...
最新文章
- 旷视MegEngine网络搭建
- 华尔街英语软件_华尔街英语吧啦吧啦聊点啥:美式“人情世故”
- 3、Swing布局管理器
- 洛谷 - P4717 【模板】快速莫比乌斯/沃尔什变换 (FMT/FWT)
- Spring和AspectJ的领域驱动设计
- RAC 之 RMAN 备份
- 原创 | 2020年Java程序员应该学习的10大技术
- 2016年度最受欢迎中国开源软件评选
- Android 应用开发----ViewPager---2.四大函数
- vsftpd配置虚拟用户(实战)
- 插件前奏-android黑科技 hook介绍
- Spring 注解编程之注解属性别名与覆盖
- 使用ffmpeg获取影片信息
- springboot mybatis 后台框架平台 集成代码生成器 shiro 权限
- getTickCount()函数 区别GetTickCount()函数
- 2022年中国工业机器人市场现状研究分析与发展前景预测报告
- Idea修改主题,字体等常规操作
- 分布式id黑科技完善
- IDEA “Cannot resolve symbol” 解决办法
- 网站添加百度分享工具的好处
热门文章
- C/C++面试题总结
- RHCE课程-RH033Linux基础笔记五之常用文本处理命令、输入输出重定向、管道
- Win10将引入HomeHub功能 和Google Home和Amazon Echo竞争
- CI restful小试(二)
- centos7安装kibana5.x
- 数据库某些要注意的问题(转的,侵权删除)
- CSS z-index 属性的使用方法和层级树的概念
- RequestUtils : Struts1.3.8 Code Review [2]
- 配置Voice vlan
- 固件攻击可在隐藏的SSD区域释放持久性恶意软件