<script type="text/javascript">
$(document).ready(function() {
$("a").click(function() {
$("#results").load( "jquery-routing.php", { pageNo: $(this).text(), sortBy: $("#sortBy").val()} );
return false;
});
});
</script>
<div id="results"> </div>
<a href="jquery-routing.php?p=1">1</a>
<a href="jquery-routing.php?p=2">2</a>
that code works fine, only problem that after I run it all my a href links stop to work! The links become jquery ajax calls.. why?
To target specific links, use the id or class tag on your anchor tags.
E.g.
Do note that id tags are unique within a page and can only be used once.
Reference those links in jQuery using:
or you can combine both:
What you need to do is assign an id or class tag to the link that will call the ajax request. E.g.
<a class="ajax" href="">ajax</a>and referencing it with$('a.ajax').click(function () {}