title: Prevent an auto reload caused by jquery scroll function
body: <p>I'm using a simple piece of code inorder to have internal links scrolls to specific divs. It works they way I intended but it also reloads the page. The scroll works perfect, just that I need it to not reload the page. Also if this matters, Im using this inside a Wordpress theme I created. </p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;a href="#hiremenow"&gt;This may sound crazy, So hire me maybe?&lt;/a&gt;
  &lt;div id="hiremenow"&gt;&lt;/div&gt;
  
  SCRIPT:
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  
  $(document).ready(function(){
      $('a[href^="#"]').on('click',function (e) {
          e.preventDefault();
          var target = this.hash,
          $target = $(target);
          $('html, body').stop().animate({
              'scrollTop': $target.offset().top
          }, 900, 'swing', function () {
              window.location.hash = target;
           void(0);
          });
      });
  
  });
  </code></pre>