如何在窗口间进行数据传递 如何在窗口间进行数据传递,当在一个窗口内点击了一个文本框,然后弹出一个窗口,在弹出窗口内输入数据,最后把计算结果返回到文本框内 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 window.opener.inputtext.value=inputtext.value 工作比较忙给你个大概的例子改改就行了。<%@ page contentType="text/html;charset=gb2312"%><html><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> JNLP错误:启动文件缺少下列必需字段 Java读取文件速度慢的问题 关于java键盘输入的问题 菜鸟搞不懂 大哥帮下 java包的问题 求助:关于文件的复制 如何把.java文件再编译成class文件后能够不被反编译回来!请高人指教 存储过程执行同步问题 jpanel问题? 有关创建不定个变量的问题,很急.... 急!请教高手:一个关于java进程的问题 请问一个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>