易截截图软件、单文件、免安装、纯绿色、仅160KB

在html web网页中父子窗口之间值的传值

在Web开发中,常常要用到两个窗口之间互相传值。下面谈谈父子窗口之间的传值:
一:使用Open开启子窗口
1:单值传递
通过open开启的子窗口比较好处理。
页面窗口1.html代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<body>
<form name="dForm" id="dForm" method="post" onsubmit="return dFormCK();" action="abc.php">
<input type="text" size="30" name="p" id="p" value=""/>
</form>
<a href="javascript:void(0)" onclick="window.open('2.html','child','width=400,height=300,left=200,top=200');">打开子窗口</a>
</body>
</html>
Open后弹出的子窗口2.html:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<base target="_self"> 
<body>
<input type="button" onclick="JavaScript:window.opener.document.getElementById('p').value='ok';window.close();" value="确定">
</body>
2:多值传递
多值的值的传递与单值传递是一模一样的。
页面窗口1.html代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<body>
<form name="dForm" id="dForm" method="post" onsubmit="return dFormCK();" action="abc.php">
<input type="text" size="30" name="p0" id="p0" value=""/><br />
<input type="text" size="30" name="p1" id="p1" value=""/>
</form>
<a href="javascript:void(0)" onclick="window.open('2.html','child','width=400,height=300,left=200,top=200');">打开子窗口</a>
</body>
</html>
Open后弹出的子窗口2.html:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<base target="_self"> 
<body>
<input type="button" onclick="JavaScript:window.opener.document.getElementById('p0').value='值一';window.opener.document.getElementById('p1').value='值二';window.close();" value="确定">
</body>
二:使用showModalDialog开启子窗口
1:


相关文档:

Zen Coding: 一种快速编写HTML/CSS代码的方法


Zen Coding: 一种快速编写HTML/CSS代码的方法
来源:http://www.javaeye.com/news/13149
译自:Smashing Magazine
中文:Zen Coding: 一种快速编写HTML/CSS代码的方法
在本文中我们将展示一种新的使用仿CSS选择器的语法来快速开发HTML和CSS的方法。它由Sergey Chikuyonok开发。
你在写HTML代码(包括所有标签、属性、 ......

通过HTML 注释性语法判断IE版本

Example:
1.<!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
2.<!--[if IE]> 所有的IE可识别 <![endif]-->
3.<!--[if IE 5.0]> 只有IE5.0可以识别 <![endif]-->
4.<!--[if IE 5]> 仅IE5.0与IE5.5可以识别 <![endif]-->
5.<!--[if gt IE 5.0]> IE ......

修复HTML图标关联

HTML和HTM文件在一次杀毒后都变成了可执行文件图标的样式。在网上搜索了若干方法都不得其解。最后查了一下资料,原来是注册表中有个可有可无的键值的存在造成的,这个就是:
HKEY_CLASSES_ROOT\htmlfile\ShellEx\lconHandler
删除lconHandler后,所有HTML和HTM文件都变成了未知文件的样式,还需要再到“控制面板&rdq ......

wxWidgets access html file in zip package

/************************************************************************
* Description: 访问zip中的htm 之 Widgets学习
* Author: 陈相礼
* Compiled: VC8 + wxWidgets2.8.10
* Date: 04/02/10
************************************************************************/
/******************************** ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号