Are you trying to connect history api but it does not work the back button in the browser , the title itself is changed but the page remains the same what's the problem?
if (data.status == 200) { var url = $(this).attr("href"); var title = $(this).attr("href"); if(url != window.location){ window.history.pushState('object', title , url); } document.body.style.overflow = 'hidden'; $('.lightbox-container').html(data.html); addEventListener('popstate', function (event) { event.state; // this contains the state data from `pustState`. Use it to decide what to change the page back to. }