template::add_refresh_on_history_handler (public)
template::add_refresh_on_history_handler
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):
- Testcases:
- templates_and_scripts
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 ) { window.location.reload(); } }); }XQL Not present: Generic, PostgreSQL, Oracle