父页面index.htm有以下内容:
<a name="top" id="top"></a>



<div width="680">
  <iframe src="outline.html" width="680" height="800"  frameborder="0"name="event" id="event" style="overflow:hidden"></iframe>
</div>子页面outline.html有以下内容:<div ><a href="#top">返回页面最前端</a> ▲</div>想在点击[子页面outline.html]的[返回页面最前端]时,显示父页面的[<a name="top" id="top"></a>]部分。请问,[子页面outline.html]的这个herf怎么写?

解决方案 »

  1.   

    <div ><a href="#top" onclick="javascript:top.document.getElementById('top').style.display = 'block'">返回页面最前端</a> ▲</div>
      

  2.   

    href="#top"这个改成javascript:void(0)
    如果你页面上没有锚点的话~·
    <div ><a href="javascript:void(0)" onclick="javascript:top.document.getElementById('top').style.display = 'block'">返回页面最前端</a> ▲</div>
      

  3.   

    <div ><a href="javascript:void(0)" onclick="javascript:parent.document.getElementById('top').style.display = 'block'">返回页面最前端</a> ▲</div>
    这个方法试过了,不行啊。
      

  4.   

    <div ><a href="javascript:void(0)" onclick="javascript:parent.location = 'index.htm#top'">返回页面最前端</a> ▲</div>这样~·
      

  5.   

    ><a href="javascript:void(0)" onclick="javascript:parent.location = 'index.htm#top'">这样使用后,结果抛错。
    内容是主页面index.htm不能打开。操作中断
      

  6.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">  
      <head>
        <title>The First Web Page</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      </head>
      <body>
        <a name="top" id="top"></a>
    <div width="680">
      <iframe src="111111111.html" width="680" height="800" frameborder="0"name="event" id="event" style="overflow:hidden"></iframe>
    </div>
      </body>
    </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>无标题文档</title>
    </head><body>
    <div ><a href="javascript:void(0)" onclick="javascript:parent.location = 'Untitled-7.html#top'">返回页面最前端</a> ▲</div>
    </body>
    </html>
    我试了下~·没发现问题