周浩

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 ::  :: 管理 ::
            28 隨筆 :: 0 文章 :: 16 評論 :: 0 Trackbacks

          接受數(shù)據(jù)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>
          發(fā)送數(shù)據(jù)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="發(fā)送" onclick="returnResult()">
          </form>
          ?</body>
          </html>

          posted on 2006-05-18 15:04 Derek 閱讀(2206) 評論(4)  編輯  收藏

          評論

          # re: 用javascript實現(xiàn)2個頁面之間互相傳值[未登錄] 2007-08-09 16:46 豬豬
          你這代碼不成功啊   回復(fù)  更多評論
            

          # re: 用javascript實現(xiàn)2個頁面之間互相傳值[未登錄] 2007-08-09 16:48 豬豬
          在form2那里form1都沒定義 咋傳給form1呢 一按按扭頁面就報錯了   回復(fù)  更多評論
            

          # re: 用javascript實現(xiàn)2個頁面之間互相傳值 2008-06-15 23:21 xiaosa
          你自己不會,哈哈  回復(fù)  更多評論
            

          # re: 用javascript實現(xiàn)2個頁面之間互相傳值 2008-12-08 16:52 daoyongyu
          是報錯。  回復(fù)  更多評論
            


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          Google
          主站蜘蛛池模板: 宁国市| 连平县| 怀宁县| 贡觉县| 拜城县| 本溪市| 社旗县| 保康县| 揭西县| 福泉市| 尉氏县| 清涧县| 读书| 赞皇县| 寻乌县| 安达市| 宣恩县| 弋阳县| 禹州市| 建德市| 库伦旗| 云龙县| 襄城县| 宽城| 渝中区| 光泽县| 托里县| 上栗县| 阿坝| 郯城县| 九龙坡区| 昌图县| 瓮安县| 和硕县| 灌云县| 屏南县| 郁南县| 吴川市| 荔波县| 庆阳市| 仪陇县|