Since the performance of iOS is better in cached pages, the back of the General page will save the previous history page,
JS on the page is not triggered, so it can trigger to the Popstate event, while some versions of WebKit popstate
The understanding is inconsistent with the official standard, which causes each access page to be synced to the history of this page,
So popstate is triggered, and in the project requires iOS a back Refresh page
Code:
Window.addeventlistener (' Popstate ', function () { window.location.reload ();});
But the page after entering the page constantly triggered the above method, refresh the page, this webkit to Popstate of the strange behavior caused.
The perception of this difference is the cause of the bizarre behavior in WebKit. WebKit did not separate HTML5 's history from the traditional one, and according to the official document's description of Popstate, the popstate is triggered as long as the historical record is accessed. Traditionally, access pages and production history are at the same time. So in WebKit, either refreshing or accessing a new page will trigger popstate. In other browsers, this popstate is used only for the history of HTML5, and does not respond to traditional history, let alone refreshing and accessing new pages.
WORKAROUND: Delay the event load so that the Popstate event is loaded after the page has finished loading.
Window.onload=function () { setTimeout (function () { window.addeventlistener (' Popstate ', function () { Window.location.reload ();}); },0) }
The bizarre behavior of mobile-popstate