周浩

  BlogJava :: 首页 :: 新随笔 :: 联系 ::  :: 管理 ::
  28 随笔 :: 0 文章 :: 16 评论 :: 0 Trackbacks

接受数据tt.html代码:
<html>
 <head>
   <script language=javascript>
 function selectPerson(username_txt)
{
 var indexes = window.showModalDialog("rr.html",form1,"dialogHeight:300px;dialogWidth:400px;help:no") + "";
 if (indexes!="undefined"){
   // alert("indexes = " + indexes);
    username_txt.value =  form1.username.value ;

 }
}
</script>
 </head>

 <body>
   <form name="form1" method="post">
 <input name="username" readonly ><a onclick="javascript:selectPerson(form1.username);" style="cursor: hand; color: #000000"><INPUT type="button" value="接受" name="btn1">
</form>
 </body>
</html>
发送数据rr.html代码
<html>
 <head>
   <script language=javascript>
  function returnResult(){
     if(form2.username.value==""){
     alert("null");
  }else{
     form1 = window.dialogArguments;
  form1.username.value = form2.username.value;
  window.close();
  }
}
</script>
 </head>

 <body>
   <form name="form2" method="post">
 <input name="username" value="derek">
 <input type="button" value="发送" onclick="returnResult()">
</form>
 </body>
</html>

posted on 2006-05-18 15:04 Derek 阅读(2186) 评论(4)  编辑  收藏

评论

# re: 用javascript实现2个页面之间互相传值[未登录] 2007-08-09 16:46 猪猪
你这代码不成功啊   回复  更多评论
  

# re: 用javascript实现2个页面之间互相传值[未登录] 2007-08-09 16:48 猪猪
在form2那里form1都没定义 咋传给form1呢 一按按扭页面就报错了   回复  更多评论
  

# re: 用javascript实现2个页面之间互相传值 2008-06-15 23:21 xiaosa
你自己不会,哈哈  回复  更多评论
  

# re: 用javascript实现2个页面之间互相传值 2008-12-08 16:52 daoyongyu
是报错。  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航:
 
Google