如何在窗口间进行数据传递,当在一个窗口内点击了一个文本框,然后弹出一个窗口,在弹出窗口内输入数据,最后把计算结果返回到文本框内
解决方案 »
- 求解一道关于素数的问题,谢谢!
- 请问开源软件靠什么赚钱
- java调用MYSQL存储过程问题
- 我这样写正则有问题吗?
- 一个程序运行时,提示:Exception in thread "main" java.lang.NoClassDefFoundError: Ott/java,是何意思?
- jdk1.4在WIN XP环境下则么配置 好象和WIN2000下不一样阿
- 接着请教applet运行在MS的1.1的JVM上的问题,--(如何在编译或运行时查错)
- oracle语句 start with ....connect by中怎样对子结点排序??
- SWT 在tabitem中加入多个控件
- 关于字体的问题
- 请问一个jdk1.5中ArrayList的问题
- 关于JDBC的基础问题
<head>
<title>
测试页面一
</title>
<script language="javascript">
function openPage(id) {
var val=document.form1.text1.value;
openwin("../pagetransvalue/test2.jsp?value="+val, "test2",0,0,640,480); } function openwin(URL,winName,leftMargin,topMargin,winWidth,winHeight){ window.open(URL,winName,"left="+leftMargin+" top="+topMargin+" width="+winWidth+", height="+winHeight+" menu=yes status=yes resizable=no scrollbars=yes");
}
</script>
</head>
<body bgcolor="#606060">
<form name="form1" method="post">
<table align="center" border="4" cellpadding="0" cellspacing="0" width="60%">
<tr>
<th colspan="2" style="text-align:center;font-family:隶书;font-weight:bold;color:#990000;">测试页面一</th>
</tr>
<tr>
<td width="60%" align="center">
<input name="text1" size="36">
</td>
<td width="40%" align="center">
<a href="javascript:openPage(this);">LinkPage</a>
</td>
</tr>
</table>
</form>
</body>
</html>
<%@ page contentType="text/html;charset=gb2312"%>
<html>
<head>
<title>
测试页面二
</title>
<script>
function returnValue() {
window.opener.document.form1.text1.value = document.form2.text2.value;
window.close();
return;
}
</script>
</head>
<body bgcolor="#606060">
<form name="form2" method="post">
<table align="center" border="4" cellpadding="0" cellspacing="0" width="60%">
<tr>
<th colspan="2" style="text-align:center;font-family:隶书;font-weight:bold;color:#990000;">测试页面二</th>
</tr>
<tr>
<td width="60%" align="center">
<%
String str=request.getParameter("value");
str= new String(str.getBytes("ISO-8859-1"),"GB2312");
%>
<input name="text2" size="36" value="<%=str%>" hidefocus>
</td>
<td width="40%" align="center">
<input type="button" name="button" value="将结果返回" onclick="returnValue();">
</td>
</tr>
</table>
</form>
</body>
</html>