Just use jquery:
jQuery( document ).ready(function( $ ) { //Use this inside your document ready jQuery $(window).on('popstate', function() { location.reload(true); }); });
The above will work 100% when you press the back or forward button with ajax.
if this does not happen, there should be an incorrect configuration in another part of the script.
For example, it may not restart if one of the examples is used in the previous message window.history.pushState('', null, './');
so when you use history.pushState(); make sure you use it correctly.
The suggestion in most cases you just need:
history.pushState(url, '', url);
There is no window.history ... and make sure the URL is defined.
Hope this helps.
Francesco
source share