title: Stop javascript onclick 'page jumping'
body: <p>Can't seem to prevent the jump to top of page behavior.</p>
  
  <p>I've tried everything suggested here <a href="https://stackoverflow.com/questions/1631924/preventing-onclick-page-jumps"><a href="https://stackoverflow.com/questions/1631924/preventing-onclick-page-jumps">preventing onclick page jumps</a></a></p>
  
  <p>What else could be done to stop onclick page jumps?</p>
  
  <p>Thanks.</p>
  
  <p>Here's a snippet of the HTML and JS</p>
  
  <pre><code>HTML:
  
  &lt;a href="javascript: return null;" onclick='javascript:getPosts("page=1&amp;display=all"); return false;'&gt;Everyone&lt;/a&gt;
  
  
  JS:
  
  function getPosts(qry) {
      var thePage = 'posts.php?' + qry;
      myReq.open("GET", thePage, true);
      myReq.onreadystatechange = theHTTPResponse;
      myReq.send(null);
  }
  
  function theHTTPResponse() {
      if (myReq.readyState == 4) {
          if(myReq.status == 200){
              var response = myReq.responseText;
              document.getElementById('posts').innerHTML = response;
          }
      } else {
          document.getElementById('posts').innerHTML = '&lt;img src="images/ajax-loader.gif" /&gt;';
      }
  }
  </code></pre>