News for hackers. Stuff that matters.

cswangpeng

Re:Approach to detect if end user press F5 or refresh button on Monday November 23, 2015 @12:49AM (#10613089)
it is very important for single page application. In such application we need detect this from framework routing entry.

Approach to detect if end user press F5 or refresh button

It is important to detect if end user press F5 or refresh button is very important for popular single page application. Becasue we need at the time to redraw whole layout. Recently implement it in project with below code,window.onbeforeunload = function () { sessionStorage.setItem('refresh', true); };var isRefreshingPage = function () { var oldState =...

( Read More... | 6 comments | on HN )