如何将“a href click”传递给jquery

i am trying to put a pagination page into jquery. example.html?id=foo&get=23

i would like to pass the get= into the jquery script so that i can change the page within the div instead of sending the link to the having the user see example.html?id=foo&get=23, they should only see example.html?id=foo. the rest is done in jquery.

<script >
$(document).ready(function()
 {
 $("#data").load("page.php?ht=<?php print $id; ?>&p=1"  );
 $("#next").click(function(){
  var pageNum = this.id;
  $("#content").load("page.php?ht=<?php print $id; ?>&p=" + pageNum, Hide_Load());
 });
});

<div id="data"> 
    <a href="example.html?id=foo" id="next">page1</a> 

</div> 

you need something like this:

$(document).ready(function(){
  $("#next").click(function(){
      $.post('your_script_to_get_values.php',
         { page: "1" },
         function(data) {
         $('#content').html(data);
       });
     });
  });  

The simplest way would be with a session variable.

Why not modify the anchor

$('#next').attr("href","example.html?id=45");

After every click on the page?

Make sure you use a live click handler, and not just a click handler, because you are creating the #next element after the page loads.

$("#next").live('click', function(){  //etc.

Documentation for .live()

It matches the current selector now and in the future (i.e. if the elements are created dynamically).