How to implement non-refresh modified browser Url with Html5
This article introduces the relevant knowledge of "how to achieve non-refresh modified browser Url in Html5". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Ajax local refresh can modify browser address through the new features of HTML5.
Window.history represents the history of window objects
Window.history.pushState (object, title, new_url)-add a history point to window.history
Window.history.replaceState (object, title, new_url)-A history point where window.history replaces the current page
Object-you can extend the object you want
Title-currently not supported by all browsers
New_url browsers will not check whether url exists, only change the url,url must be in the same domain, not cross-domain
Eg: original url: www.test.com
Window.history.pushState ({time: 'test'},', 'www.test_test.com')
This is the end of the content of "how to achieve non-refresh modified browser Url in Html5". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!