parent.document.title = document.title

解决方案 »

  1.   

    代码要放在哪一个页面上呢,
    如果放在index.html上
    document.title   =   mainFrame.document.title
      

  2.   

    还是不会,请问能给完整的代码吗?我要放在index.html上面,要他的title和mainFrame的title同步,谢谢!
      

  3.   

    index.html
    <title>这里要和mainFrame同步</title>
    <frameset       cols="80,*"       frameborder="NO"       border="0"       framespacing="0">           
                <frame       name="leftFrame"       scrolling="NO"       noresize       src="leftFrame.htm">       
                <frame       name="mainFrame"       src="mainFrame.html">       
        </frameset>       
    mainFrame.html
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 2</title>
    </head>
    <body>
    </body>
    </html>
    就是要把mainFrame.html的"新建网页 2"传递到index.html的"这里要和mainFrame同步"
    谢谢!
      

  4.   

    mainFrame.html 
    <html> 
    <head> 
    <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312"> 
    <title> 新建网页   2 </title> 
    </head> 
    <body> 
    <script>
    parent.document.title=document.title;</script>
    </body> 
    </html>