I am refreshing some pages with AJAX and so an updating the history with the following code -
/** Update the page history */
var pushState_object = {
ajax_string: ajax_string,
security: security,
};
window.history.pushState(pushState_object, title, permalink);
I am then calling this onPopState function on page load -
window.onpopstate = function(e){
if(window.history.state !== null){
initiate_load_updated_page(window.history.state.ajax_string, window.history.state.security, 0)
}
}
I am having a slight problem though using the back button when going from a page where the content was generated through AJAX to a page that was loaded in the usual way. The URL will change, but the page will not reload. Clicking back again takes me to the page before, as I would expect, and then going forward works fine - it is just that one situation where the back button does not work.
Any suggestions here would be appreciated.