请教个问题,怎样让下个页面的东西的,传到上个页面???谢谢 如果只是输入一些信息,用javascript中的prompt应该可以吧。如果一定要一个页面的话,你只有A->B->A也就是要刷新A页因为A页面显示完后,就是一个静态页面,在不刷新时只能用javascript来控制 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 要实现此功能最好使用带有返回值的showModalDialog如下在"选择人员"的onclick="msg()"function msg(){var str str=window.showModalDialog("select.jsp")//str为返回的值document.form1.name.value=str//把得到的给name}在select.jsp中function ok(){var b="" b=document.form1.select2.value//b=document.form1.select2.text window.returnValue=b window.close()}function cancel(){window.returnValue=""window.close()}<input type="button" name="gg" value="确定" onclick="ok()">  <input type="button" name="can" value="取消" onclick="cancel()"> 我想理论上是可以的在B页面中填入的东西,可以存放在服务器端的session中,在b页面关闭的时候,让服务器将A页面刷新,并将session中内容填入A页面 两种方法:1 打开模态窗口,获取返回值,用脚本填充主窗口相关域。优点:窗口联系层次分明,缺点:跳转翻页等实现起来痛苦,返回值只能是一个字符串,对于回填多个域要另做字符串的合并与拆解实现。2 打开非模态窗口,在子窗口关闭前,直接用window.opener来引用源窗口的域并填充值。优点:实现翻页,跳转非常方便,无需特别控制。而且易填充多个域。缺点:与源窗口的联系相对弱,一旦用户切换源窗口控制难。举例:parent.html中的中有一form,其中dept栏须用帮助窗口来辅助输入。用两个按钮分别来演示模态窗口实现和非模态窗口实现:<!--parent.html--><html><head><script>function getForce(){ var sRtn sRtn = window.showModalDialog("help1.html") form1.dept.value=sRtn}function getFree(){ window.open("help2.html")}</script></head><body><form name="form1">请输入部门名称:<input value="" readonly name="dept" type="text" ><br><input type=button name="强制输入" value="force" onclick="getForce()"><input type=button name="自由输入" value="free" onclick="getFree()"></form></body><html><!--help1.html--><html><head><script>function returnWithValue(s){ window.returnValue=s window.close()}</script></head><body><table><tr bgcolor='#cccccc'><td>编码</td><td>单位名称</td></tr><tr onclick="tmp.value='单位1'" ondblclick="this.onclick;ok.click()"><td>111</td><td>单位1</td></tr><tr onclick="tmp.value='单位2'" ondblclick="this.onclick;ok.click()"><td>222</td><td>单位2</td></tr></table><input type="hidden" value="" name="tmp"><input type=button name="ok" value="确定" onclick="returnWithValue(tmp.value)"><input type=button name="cancel" value="取消" onclick="returnWithValue('')"></form></body><html><!--help2.html--><html><head><script>function returnWithValue(s){ var winSource= window.opener winSource.form1.dept.value=s window.close()}</script></head><body><table><tr bgcolor='#cccccc'><td>编码</td><td>单位名称</td></tr><tr onclick="tmp.value='单位1'" ondblclick="this.onclick;ok.click()"><td>111</td><td>单位1</td></tr><tr onclick="tmp.value='单位2'" ondblclick="this.onclick;ok.click()"><td>222</td><td>单位2</td></tr></table><input type="hidden" value="" name="tmp"><input type=button name="ok" value="确定" onclick="returnWithValue(tmp.value)"><input type=button name="cancel" value="取消" onclick="returnWithValue('')"></body><html> 弹出框做查询 一个很诡异的问题 jsp如何禁用cookie 怎样在myeclips中创建一个servlet页面 HTTP Status 404 错误的问题 多个网页公共的导航栏 iReport 3.0运行出错,不知道这是什么原因? 请问各位: servlet的简单问题!(急!在线等) 这样写有啥毛病哪?? 请问一个JSP配置的问题,我现在系统上装了Jbuilder6.0 ,dreamweaver,操作系统是2000 server,我如何在Dreamweaver中用JSP来做网页? 文件上传
在"选择人员"的onclick="msg()"
function msg()
{
var str
str=window.showModalDialog("select.jsp")//str为返回的值
document.form1.name.value=str//把得到的给name
}
在select.jsp中
function ok()
{var b="" b=document.form1.select2.value
//b=document.form1.select2.text window.returnValue=b
window.close()
}
function cancel()
{window.returnValue=""
window.close()}
<input type="button" name="gg" value="确定" onclick="ok()">
 
<input type="button" name="can" value="取消" onclick="cancel()">
1 打开模态窗口,获取返回值,用脚本填充主窗口相关域。优点:窗口联系层次分明,缺点:跳转翻页等实现起来痛苦,返回值只能是一个字符串,对于回填多个域要另做字符串的合并与拆解实现。
2 打开非模态窗口,在子窗口关闭前,直接用window.opener来引用源窗口的域并填充值。优点:实现翻页,跳转非常方便,无需特别控制。而且易填充多个域。缺点:与源窗口的联系相对弱,一旦用户切换源窗口控制难。举例:parent.html中的中有一form,其中dept栏须用帮助窗口来辅助输入。用两个按钮分别来演示模态窗口实现和非模态窗口实现:
<!--parent.html-->
<html>
<head>
<script>
function getForce(){
var sRtn
sRtn = window.showModalDialog("help1.html")
form1.dept.value=sRtn
}
function getFree(){
window.open("help2.html")
}
</script>
</head>
<body>
<form name="form1">
请输入部门名称:<input value="" readonly name="dept" type="text" >
<br>
<input type=button name="强制输入" value="force" onclick="getForce()">
<input type=button name="自由输入" value="free" onclick="getFree()">
</form></body>
<html><!--help1.html-->
<html>
<head>
<script>
function returnWithValue(s){
window.returnValue=s
window.close()
}
</script>
</head>
<body>
<table>
<tr bgcolor='#cccccc'>
<td>编码</td>
<td>单位名称</td>
</tr>
<tr onclick="tmp.value='单位1'" ondblclick="this.onclick;ok.click()">
<td>111</td>
<td>单位1</td>
</tr>
<tr onclick="tmp.value='单位2'" ondblclick="this.onclick;ok.click()">
<td>222</td>
<td>单位2</td>
</tr>
</table>
<input type="hidden" value="" name="tmp"><input type=button name="ok" value="确定" onclick="returnWithValue(tmp.value)">
<input type=button name="cancel" value="取消" onclick="returnWithValue('')">
</form></body>
<html>
<!--help2.html-->
<html>
<head>
<script>
function returnWithValue(s){
var winSource= window.opener
winSource.form1.dept.value=s
window.close()
}
</script>
</head><body><table>
<tr bgcolor='#cccccc'>
<td>编码</td>
<td>单位名称</td>
</tr>
<tr onclick="tmp.value='单位1'" ondblclick="this.onclick;ok.click()">
<td>111</td>
<td>单位1</td>
</tr>
<tr onclick="tmp.value='单位2'" ondblclick="this.onclick;ok.click()">
<td>222</td>
<td>单位2</td>
</tr>
</table>
<input type="hidden" value="" name="tmp"><input type=button name="ok" value="确定" onclick="returnWithValue(tmp.value)">
<input type=button name="cancel" value="取消" onclick="returnWithValue('')">
</body>
<html>