title: anchor jumping by using javascript
body: <p>I have a question that will be found very often. The problem is that nowhere can be found an explicit solution.</p>
  
  <p>I have two problems regarding anchors.</p>
  
  <p>The main goal should be to get a nice clean url without any hashes in it while using anchors to jump on a page.</p>
  
  <p>So the structure of the anchors is:</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li&gt;&lt;a href="#one"&gt;One&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#two"&gt;Two&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#three"&gt;Three&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;div class="wrap"&gt;
      &lt;a name="one"&gt;text 1&lt;/a&gt;
      &lt;a name="two"&gt;text 2&lt;/a&gt;
      &lt;a name="three" class="box"&gt;text 3&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Okay, if you will click one of the links the url will automatically change to </p>
  
  <blockquote>
    <p>www.domain.com/page#1</p>
  </blockquote>
  
  <p>At the end this should be just:</p>
  
  <blockquote>
    <p>www.domain.com/page</p>
  </blockquote>
  
  <p>So far, so good. Now the second thing is, when you search the internet for that problem you will find <code>javascript</code> as a solution.</p>
  
  <p>I have found this function:</p>
  
  <pre><code>function jumpto(anchor){
      window.location.href = "#"+anchor;
  }
  </code></pre>
  
  <p>and calling that function with:</p>
  
  <pre><code>&lt;a onclick="jumpto('one');"&gt;One&lt;/a&gt;
  </code></pre>
  
  <p>what will be the same like before. It will add the hash to the url. I also added</p>
  
  <pre><code>&lt;a onclick="jumpto('one'); return false;"&gt;
  </code></pre>
  
  <p>without success. So if there is someone who could tell me how to solve this I really would appreciate.</p>
  
  <p>Thanks a lot.</p>