window.history.pushState contradicting other jquery codes

Viewed 26

I am trying to make ajax load for pagination using following code :

/*Ajax Pagination*/
$(function() {
    $('body').on('click', '.pagination a', function(e) {
        e.preventDefault();

        $('#fundraisers #fundraiser_main').css('background', 'red');
        $('#fundraisers').append('<img style="position: fixed; left: 30%; top: 20%; z-index: 100000;" 
src="/images/loading.gif" />');

        var url = $(this).attr('href');  
        getFundraisers(url);
        window.history.pushState("", "", url);
    });

    function getFundraisers(url) {
        $.ajax({
            url : url  
        }).done(function (data) {
            $('body').html(data);  
            // $('.c').countUp();
        }).fail(function () {
            alert('Could not be loaded.');
        });
    }
});

But after the ajax call, I am getting error for the following code I am using for my counter(number)(onscroll ) :

$(document).ready(function () {
   $('.c').countUp();
});

The error I am getting from the console is :

enter image description here

It also yielding error for the owl carousel I am using to slide categories : enter image description here

Even Bootstrap dropdown is not working after the call .

0 Answers
Related