title: Send ajax post on href click
body: <p>When i click a link i need to send <code>post</code> via <code>ajax</code>. The problem is that the request is dropped because of open a link.</p>
  
  <pre><code>jQuery('#pagination a').click(function(){
      jQuery.post('index.php?option=com_component',
          {checked_sites_for_session: jQuery('.selected-site input[type="checkbox"]').map(function () {return this.value;}).get()}
      ).success(function(){window.location = jQuery(this).attr('href')});
      console.log(jQuery(this).attr('href'));
      return false;
  });
  </code></pre>
  
  <p>But again the problems is (thanks to joomla) in url - its like <code>/~user/joomla/index.php/view-sites?view=sites&amp;page=2</code> - as you see it starts from slash, but the real link is <code>http://localhost/~user/joomla/index.php/view-sites?view=sites&amp;page=2</code>, but in the source i have <code>&lt;a href="index.php?option=com_component&amp;view=sites&amp;</code>.'.$option.'page='.$left.'"//....`</p>
  
  <p>So i need some "multipurpose domain parsing solution" or just stop joomla changing my url's.</p>