In HTML files, the history.pushState() method adds a state to the browser history. pushState() takes three parameters: a state object, a title (now ignored), and an optional URL. These three parameters will be examined in detail below: state object - The state object is a JS object related to the history created by the pushState() method. When the user is directed to a new state, the popstate event is triggered. The event's state property contains the history's state object. (Translator's Note: In short, it stores JSON strings and can be used in popstate events.) The state object can be anything that can be serialized. Since Firefox will store these objects on the user's disk, so these state objects will be restored after the user restarts the browser, we impose a maximum string of 640k on the serialized representation of the state object
1.Detailed introduction to history.pushState() usage examples in h5
##Introduction: In HTML files, the history.pushState() method adds a state to the browser history. pushState() takes three parameters: a state object, a title (now ignored), and an optional URL. The following will conduct a detailed inspection of these three parameters:
2.Create a better browsing experience-HTML5 history API
Introduction: HTML5 history API only includes 2 methods: history.pushState() and history.replaceState(), and 1 event: window.onpopstate. ,.
3.In-depth exploration of HTML5’s History API_html5 tutorial skills
Introduction: This article mainly introduces in-depth exploration The History API of HTML5 focuses on the new methods history.pushState() and history.replaceState() in HTML5. Friends who need it can refer to
[Related Q&A recommendations]:
javascript - history pushState
javascript - Questions about history.pushState()
The above is the detailed content of Recommended courses about history.pushState(). For more information, please follow other related articles on the PHP Chinese website!