History.js back button not working

433 views Asked by At

I'm doing an AJAX request and changing my URL, but when I go back on browser, my url changes to the old one but my content does not.

Here is my code:

$('.link').on('click', function (e) {
    e.preventDefault();

    History.pushState('data', '', this.href);

    $('#content').load(this.href);

});

I'm using Jquery and History.js.

Edit:

To be more clearer:

I do the ajax, my server returns to me HTML that I replace my page content with it. I use History.pushState to change my url but when I hit the browser back button, It does not go back, only my url changes.

0

There are 0 answers