template::add_refresh_on_history_handler (public)


Defined in packages/acs-templating/tcl/head-procs.tcl

Register an event handler which will trigger a complete page refresh when we land on this page by accessing the browser's history (back and forward buttons). This is useful e.g. for those pages where some push interaction is happening and retrieving the page from the browser history would display it in an inconsistent state.

Partial Call Graph (max 5 caller/called nodes):
%3 xo::ChatClass instproc login xo::ChatClass instproc login (public) template::add_refresh_on_history_handler template::add_refresh_on_history_handler xo::ChatClass instproc login->template::add_refresh_on_history_handler

No testcase defined.
Source code:
    # courtesy of: vasleo@gmail.com from Stack Overflow
    template::add_body_script -script {
        window.addEventListener( "pageshow", function ( event ) {
            var historyTraversal = event.persisted ||
            ( typeof window.performance != "undefined" &&
              window.performance.navigation.type === 2 );
            if ( historyTraversal ) {
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: