那你就点击按钮后先吧id为haha 的表中的数据取出来,然后传过去 ,  或者直接在子窗口取父窗口的表格数据

解决方案 »

  1.   

    没写表格的 一个意思<p id='haha'>
    asdfasdfasdfasdfasdfasdfasdf
    </p>
    <script language='javascript'>
    function passInfor(){
      var newwin=window.open();
      var newp=newwin.document.createElement("p");
      newp.innerHTML=document.getElementById("haha").innerHTML;
      newwin.document.body.appendChild(newp);
    }
    </script>
    <input type='button' value='传参' onclick='passInfor()'>
      

  2.   

    很是奇怪呀,大家帮我分析一下啊
    我直接用3楼给的代码,就不可以,显示了的时候空白但是~~~~~~~~~~~~~我随便加了一行
    alert("哈哈")就可以显示了,但是新的页面的源码里还是没有东西。我该怎么搞呀,求大家帮忙了,我自己研究不明白了~~~~~~~~~~
      

  3.   

    index.html
    <html>
    <head>
    <title></title>
    <script language="javascript">
    function dialogwin(fileName)

    var tbStr=test.parentElement.innerHTML var str=window.showModalDialog(fileName,tbStr,"dialogWidth:486px;dialogHeight:250px;center:1;scroll:0;help:0;status:0");
    if(str!=undefined) 
    {
    alert('成功');
    }
    }
    </script>
    </head>
    <body>
    <span>
    <table id='test' border='1'>
    <tr>
    <td>aaaaa</td>
    <td>bbbbb</td>
    </tr>
    </table>
    </span>
    <input type=button name=aa value="测试" onclick="javascript:dialogwin('2.htm');">
    </body>
    </html>2.html
    <script>  
    var tbStr = window.dialogArguments; //关键代码

     
    function initPage()
    {
    show.innerHTML=tbStr;
    }
     
    </SCRIPT><body bgcolor="#eeeeee" onload='initPage()'>
    <span id='show'>
    </span>
    </body>
      

  4.   

    dialog模式不能支持打印功能,能不能再帮我像个办法呀,谢谢大家了~~~~~~~~~~~~~
      

  5.   


    <script language='javascript'>
    function passInfor(){
    var newwin=window.open("priview.html","预览");
    var newp=newwin.document.getElementById("show");
    newp.innerHTML = document.getElementById("haha").innerHTML;
    document.execCommand("refresh");
    }
    </script>
    <p id="haha">
    asdfasdfasdfasdfasdfasdfasdfADSAFDASDFASFDSAF
    </p>
    我再js里这样用,还是不行,请大家帮我修正,谢谢了~~~~
      

  6.   

    可以阿,在子窗口中写一个父窗口对象 
    parent = window.opener;
    通过父窗口对象 parent  就能取到父窗口中的值了;
    var  value= parent.document.getElementById("父窗口元素").value;
    不过前提是父窗口不可以关闭,否则父窗口对象 parent  就取不到了。