title: How to do an onclick ajax call to a php file, with jquery?
body: <p>I have a link, which links to domain.com , when a person clicks, I want it to do an ajax call to counter.php and post 2 variables to it, so it can add 1 to the views for that link. </p>
  
  <p>I have a link:</p>
  
  <pre><code>&lt;a href="http://www.domain.com" onClick="addHit('12345', '1')" rel="nofollow" target="_blank"&gt;Link Title&lt;/a&gt;
  </code></pre>
  
  <p>How would I do this with jquery? </p>
  
  <p>EDIT:</p>
  
  <p>I tried something like this</p>
  
  <pre><code>function addHit(str, partNumber){
  $.get("counter.php", { version: str, part: partNumber })                
  }
  </code></pre>
  
  <p>It seems to work, but in firebug, the request never completes... it just does that "working..." animation. counter.php echos out some text when its done (doesnt need to show up anywhere).</p>