title: Issue with jQuery.ajax() for pagination
body: <p>I'm using magento as my CMS, trying to implement ajax for pagination,</p>
  
  <p>I have 2 pages at the moment, the structure is such,</p>
  
  <pre><code>&lt;div class="pager"&gt;
          &lt;div class="pages"&gt;
            &lt;strong&gt;Page:&lt;/strong&gt;
            &lt;ol&gt;
               &lt;li class="current"&gt;1&lt;/li&gt;
               &lt;li&gt;
                  &lt;a href="http://localhost/Bakestore/index.php/tools.html?p=2" class="pageLinks"&gt;2&lt;/a&gt;&lt;/li&gt;
               &lt;li class="pager_next_img"&gt;
                  &lt;a class="next i-next pageLinks" href="http://localhost/Bakestore/index.php/tools.html?p=2" title="Next"&gt;
                  &lt;img src="http://localhost/Bakestore/skin/frontend/default/Bakestore_Theme/images/pager_arrow_right.gif" alt="Next" class="v-middle"&gt;
                  &lt;/a&gt;
              &lt;/li&gt;
            &lt;/ol&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>my jQuery ajax code is as below,</p>
  
  <pre><code>$j(".pages li a").each(function(){
      $j(this).removeClass('pageLinks').addClass('pageLinks');                                
  });
  
  $j(".pageLinks").click(function(e){
      e.preventDefault();
      var anchorSel =  $j(this).attr('href');
      $j.ajax({
          type: "POST", 
          datatype: "HTML",
          cache: true,
          url: anchorSel,
  
          success: function(data){
              var testdata = $j(data).find(".category-products");
              $j(".col-main .category-products").replaceWith(testdata);
              },
  
          complete: function(data){
                          $j(".pages li a").each(function(){
                              $j(this).removeClass('pageLinks').addClass('pageLinks');                            });
                              alert($j(".col-main .category-products .toolbar &gt; .pager").html());
                           }
  });
  </code></pre>
  
  <p>It works fine when I click <code>Page 2</code>, but, from page 2 when I hit <code>Page 1</code>, the page reloads. Now when I hit <code>Page 2</code> again, it works fine.</p>
  
  <p>I debugged my jQuery, sadly, the event <code>$j(".pageLinks").click</code> is not getting fired at all (when I click on <code>Page 1</code>).</p>
  
  <p>Any idea where I'm going wrong?</p>