关于两个页面之间传值,和打开新的页面的问题

我要问的问题分两个细节:  
1、在A页面上,点击某一处(一般是某个按钮或者是某个图片),在不关闭A页面的情况下,打开B页面。最好可以控制B页面显示的大小。  
2、在上一个问题解决的基础上,点击B页面的某一处,关闭B页面,在A页面的某个控件(一般是文本框)显示某个值。就是在B页面中选定某个值,然后将该值显示在A页面的相应控件中。  
以上两个问题最后能有例子。  
急用!解决问题马上给分!!!  
---------------------------------------------------------------  
 
用frame框架结构试试  
---------------------------------------------------------------  
 
UP  
---------------------------------------------------------------  
 
a.htm  
 
<!DOCTYPE  HTML  PUBLIC  "-//W3C//DTD  HTML  4.01  Transitional//EN">  
<html>  
<head>  
<meta  http-equiv="Content-Type"  content="text/html;  charset=gb2312">  
<title>无标题文档</title>  
<script  language="JavaScript"  type="text/JavaScript">  
<!--  
function  MM_openBrWindow(theURL,winName,features)  {  //v2.0  
   window.open(theURL,winName,features);  
}  
//-->  
</script>  
</head>  
 
<body>  
<form  name="form1"  method="post"  action="">  
   <table  width="400"  border="0"  align="center"  cellpadding="0"  cellspacing="0">  
       <tr>    
           <td  width="94">&nbsp;</td>  
           <td  width="306">&nbsp;</td>  
       </tr>  
       <tr>    
           <td>&nbsp;</td>  
           <td><input  name="text"  type="text"  id="text"></td>  
       </tr>  
       <tr>    
           <td>&nbsp;</td>  
           <td>&nbsp;</td>  
       </tr>  
       <tr>    
           <td>&nbsp;</td>  
           <td>&nbsp;</td>  
       </tr>  
       <tr>    
           <td>&nbsp;</td>  
           <td><input  name="Submit"  type="button"  onClick="MM_openBrWindow('/b.htm','','scrollbars=yes,width=300,height=400')"  value="打开新窗口"></td>  
       </tr>  
   </table>  
</form>  
</body>  
</html>  
 
 
b.htm  
 
<!DOCTYPE  HTML  PUBLIC  "-//W3C//DTD  HTML  4.01  Transitional//EN">  
<html>  
<head>  
<meta  http-equiv="Content-Type"  content="text/html;  charset=gb2312">  
<title>无标题文档</title>  
</head>  
<script>  
     function  returnText()  {  
             window.opener.form1.text.value=form1.text.value;  
                 window.close();  
     }  
</script>  
 
<body>  
<table  width="100%"  height="300"  border="0"  cellpadding="0"  cellspacing="0">  
   <tr>    
       <td  align="center"><form  name="form1"  method="post"  action="">  
               <input  name="text"  type="text"  id="text"  value="请输入你的内容">  
               <br>  
               <input  type="button"  name="Submit"  value="关  闭"  onClick="returnText()">  
           </form>  
             
       </td>  
   </tr>  
</table>  
</body>  
</html>  
 
---------------------------------------------------------------  
 
a中用onclick事件打开b  
οnclick="javascript:window.open('b','','toolbar,resizable,scrollbars=auto,dependent,width=400,height=280');"  
 
点击B页面的某一处触发javascript事件  
<script  language="javascript">  
<!--  
function  check()  
{  
window.opener.document.form1.roomID.value=form1.roomID.value;    
window.close();  
}  
</script>  
---------------------------------------------------------------  
 
<a  href=#  οnclick="window.open  ('AddUser.aspx',  'newwindow',  'height=280,  width=320,  top=150,  left=300,  toolbar=no,  menubar=no,  scrollbars=no,  resizable=no,location=n  o,  status=no')">new  window</a>  
---------------------------------------------------------------  
 
1)οnclick="window.open(......);"  
或 者οnclick="showModalDialog(filename,window,"status:false;dialogWidth:"+width +"px;dialogHeight:"+height+"px")";区别在于前者可以点击父页面,后者不可以。  
2)  
对于一的前者  
window.opener.document.  ......  
对于后者  
dialogArguments.document.  ...... 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值