在parent页面中弹出son页面窗口,
将值从parent页面传到son页面,并在son页面接收.
parent页面弹窗使用方法 window.showModalDialog,
son页面接收数据使用 window.dialogArguments.参数名
适用于 html,jsp
在 IE8 和 firefox 25 中测试,可以使用,
在 chrome 30.0.1599.101 m 中测试不通过。
这里使用 html 来演示
parent.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>parent</title> <script type="text/javascript"> function init(){ var url = "son.html"; window.showModalDialog(url, {sign : 1}, "dialogWidth:800px; dialogHeight:550px; resizable:yes; scroll:no;"); } </script> </head> <body onload="init()"> </body> </html>
son.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>SON</title> <script type="text/javascript"> function show(){ //alert("into"); var sign = window.dialogArguments.sign; alert(sign); } </script> </head> <body onload="show()"> </body> </html>
相关推荐
页面间传值
静态页面间传值静态页面间传值静态页面间传值静态页面间传值静态页面间传值静态页面间传值静态页面间传值静态页面间传值静态页面间传值静态页面间传值
主要介绍了JavaScript实现在页面间传值的方法,涉及javascript传值的技巧,非常具有实用价值,需要的朋友可以参考下
ASP.NET 页面间传值的几种方法 ASP.NET 页面间传值的几种方法 ASP.NET 页面间传值的几种方法 ASP.NET 页面间传值的几种方法 ASP.NET 页面间传值的几种方法
aspx页面间传值介绍 aspx页面间传值介绍
页面传值---ASP.NET之5种全局变量!页面间传值方法!.
简单用Swift -实现 tabar ,tableview,collection,以及页面间传值
asp.net 页面之间传值方法总结.
在JS里面,在A页面中打开B页面。然后在B页面中返回一个值,在A页面显示
有form1.aspx和form2.aspx两个页面,form1.aspx上有一个textBox.和button, 在form2.aspx上有一个lable。 要求: 1. 当点击form1.aspx上的button时,把textbox的值传递到form2.aspx上面显示出来. 2. 要求用三种以上的...
主要介绍了微信小程序页面间传值与页面取值操作,结合实例形式分析了微信小程序页面间传值及页面取值操作相关实现技巧与操作注意事项,需要的朋友可以参考下
是一个通过地址栏参数或Session在页面间传值,而其中的传过去的参数在地址栏是加密的!对于初学者既可以学习加密,也可以学习如何传值!加密算法是用的Rijndael加密,通用的哦,也可以用在winform中 开发工具:...
在webform中实现三种从一个页面向另一个页面的传值方法。response.Redirect、session、server.Transfer.
对于asp.net的页面间的各种传值方式进行了详细的说明
自己写的一段jquery小代码,实现了jquery的页面传值功能,代码已经编译运行通过,请各位大侠指教!
面传值是学习asp.net初期都会面临的一个问题,总的来说有页面传值、存储对象传值、ajax、类、model、表单等。但是一般来说,常用的较简单有QueryString,Session,Cookies,Application,Server.Transfer。
.net C#中页面之间传值传参的六种方法,相关事例和代码
javascript 两个页面之间传值 使用window.open()
点击修改后传到另一个页面B