设一个按钮 单击它 然后本页div里的内容就被传送到另一个页里一个特定的div里了 谢谢先了

解决方案 »

  1.   


    你的另一个页面是window.open弹出来的,还是在iframe里?
      

  2.   

    不是iframe最好能是一个单独的页 但是如果没有什么办法 也可以用window.open 弹出的。
      

  3.   

    a.html<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript" src="file:///C|/JavaScript/jquery.js"></script>
    <script type="text/javascript">
    window.onload = function(){
    var bhtml = document.getElementById('bhtml');
    document.getElementById('click').onclick = function(){
    window.open('bb.html','');
    };
    };
    </script>
    </head><body>
    <div id="a">我a页面的值</div>
    <input type="button" id="click" value="click me" />
    </body>
    </html>
    b.html<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript">

    var a = opener.document.getElementById('a').innerHTML;
    alert(a);
    document.getElementById('d').innerHTML = a;</script>
    </head><body>
    <div id="d"></div>
    </body>
    </html>
      

  4.   

    window.open弹出来的,还是在iframe里都还好说,
    如果就是两个普通的页面,没有什么关系那就有难度了