我是新手
现在有个问题,不知道怎么弄。
有两个页面a.html   b.html
a.html中有一个button 一个text 点button弹出b.html 并在b.html上显示a.html中text的值
这个要怎么实现。
在线等,谢谢了。

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【fanjun5】截止到2008-07-26 10:33:03的历史汇总数据(不包括此帖):
    发帖的总数量:0                        发帖的总分数:0                        每贴平均分数:0                        
    回帖的总数量:0                        得分贴总数量:0                        回帖的得分率:0%                       
    结贴的总数量:0                        结贴的总分数:0                        
    无满意结贴数:0                        无满意结贴分:0                        
    未结的帖子数:0                        未结的总分数:0                        
    结贴的百分比:---------------------结分的百分比:---------------------
    无满意结贴率:---------------------无满意结分率:---------------------
    如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
      

  2.   

    a.html:
    <input type="text" id="src" value="srcValue" />
    <input type="button" onclick="javascript:openB();" />
    <script>
     function openB(){
      window.open("b.html");
     }
    </script>b.html:
    <script>
      window.onload()=function(){
       alert(window.opener.document.all.src.value);
      }
    </script>
      

  3.   

    a.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>a.html</title>
    </head><body>
    <form action="b.html" target="_blank" method="get">
    <input type="text" name="txt" value="" />
    <input type="submit" value="Submit" />
    </form>
    </body>
    </html>b.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>b.html</title>
    </head><body>
    <script type="text/javascript">
    var i, s = decodeURI(window.location.href);
    if ((i = s.indexOf("?")) == -1) {
    s = "";
    } else {
    s = s.substring(i + 1, s.length);
    if ((i = s.indexOf("=")) == -1) {
    s = "";
    } else {
    s = s.substring(i + 1, s.length);
    }
    }
    document.write(s);
    </script>
    </body>
    </html>
      

  4.   

    <html>
    <head>
    <script>
    function dosubit()
    {
    myform.action="b.html";
    myform.submit();
    }
    </script>
    </head>
    <body>
    <form name=myform action="" method=post>
    <input type=text name="username">
    <input type=button onclick="dosubmit();">
    </form>
    </body>
    </html>这样就可以将myform表单中的text提交到b.html中去了
      

  5.   

    get方法提交,b.html?txt=...
    可惜有长度限制
      

  6.   

    2楼的方法很好,和3楼的作个对比各有优势,window.open("b.html"); 当浏览器启用了弹出窗口屏蔽功能就无效了,但是传递数据量大(可以认为无限制),而且显示 b.html 页的浏览器地址栏比较清爽,没有一大堆传递的参数。3楼方法虽不用担心被屏蔽,但传递的数据量有上限,楼主可以根据需要作取舍。