ajax load next/prev post

Hi, I tried to follow the ajax load next/prev post in your tutorial, but I have got lost. First, click works fine. When I'm on the Older posts, the new posts are displayed, but the link at the bottom has remained same (not changed for newer posts). And vice versa if I start at page two. It's a custom theme, I can send it to you. However, I assume that it will be some small mistake.

My ajax actions:

add_action( 'wp_ajax_nopriv_ajax_pagination', 'kbnt_ajax_pagination' );
add_action( 'wp_ajax_ajax_pagination', 'kbnt_ajax_pagination' );

function kbnt_ajax_pagination() {
    $query_vars = json_decode( stripslashes( $_POST['query_vars'] ), true );
    $query_vars['paged'] = $_POST['page'];

    $posts = new WP_Query( $query_vars );
    $GLOBALS['wp_query'] = $posts;

	$postn = 0;

    if( ! $posts->have_posts() ) {
        get_template_part( 'content', 'none' );
    else {
        while ( $posts->have_posts() ) {
			include( locate_template( 'content-posts.php' ) );



function kbnt_pagination (){
	echo '<div class="col-xs-24" id="pagination">';
	echo '</div>';

My ajax-pagination.js

(function($) {
	$(document).on( 'click', '#pagination a', function( event ) {

		var pageurl = $(this).attr('href');
		var myRe = /\d+/g;
		var page = parseInt(myRe.exec(pageurl));

			url: ajaxpagination.ajaxurl,
			type: 'post',
			data: {
				action: 'ajax_pagination',
				query_vars: ajaxpagination.query_vars,
				page: page
			success: function( html ) {
				$('#clanky').find( 'article' ).remove();
				$('#clanky').append( html );