I Have a working PHP Based Pagination onto which i am adding ajax to improve page load.
my problem is ajax is adding whole navigation page(to which navigation is made through pagination link) to current page content.
and to be specific data added is whole navigation page in a div used for content display. which should be like replacing current page content with navigation page content.
my pagination is in div with id="pagination" with ul li. my repeating page content is in div with id="temp".
my ajax code
$(function(){
$('#pagination ul li a').click(function (ev) {
ev.preventDefault();
$('div#temp').load($(this).attr('href'));
});
});
and my navigatin link structure in pagination is like this
echo " <li><a href='is-test.php?page=$nextpage'>Next»»</a></li> ";
please tell me how i can make ajax to replace data insted of adding data.
Thanks.