anchors and window.history

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Timo

    anchors and window.history

    Is there any way to jump to an anchor in the current document without
    affecting window.history?
    Thanks


  • Rob B

    #2
    Re: anchors and window.history



    Timo wrote:
    [color=blue]
    > Is there any way to jump to an anchor in the current document without
    > affecting window.history?[/color]

    Umm...

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>untitled </title>
    <style type="text/css">

    .filler {
    height: 800px;
    background: steelblue;
    }
    a {
    display: block;
    }

    </style>
    <script type="text/javascript">
    //<![CDATA[

    var hasher = function(url)
    {
    top.location.re place(url);
    return false;
    }

    //]]>
    </script>
    </head>
    <body>
    <a href="#section1 " onclick="return hasher(this.has h)">Section 1</a>
    <a href="#section2 " onclick="return hasher(this.has h)">Section 2</a>
    <a href="#section3 " onclick="return hasher(this.has h)">Section 3</a>
    <div class="filler"> </div>
    <h4 id="section1">S ection 1<a href="#" onclick="return
    hasher(this.has h)">top</a></h4>
    <div class="filler"> </div>
    <h4 id="section2">S ection 2<a href="#" onclick="return
    hasher(this.has h)">top</a></h4>
    <div class="filler"> </div>
    <h4 id="section3">S ection 3<a href="#" onclick="return
    hasher(this.has h)">top</a></h4>
    <div class="filler"> </div>
    </body>
    </html>



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    • Timo

      #3
      Re: anchors and window.history

      Thanks for the suggestions!
      Timo


      Comment

      Working...