Home > Web Front-end > H5 Tutorial > Html5 method to modify browser URL without refreshing_html5 tutorial skills

Html5 method to modify browser URL without refreshing_html5 tutorial skills

WBOY
Release: 2016-05-16 15:48:34
Original
1752 people have browsed it

Ajax partial refresh can modify the browser address through the new features of HTML5.

window.history represents the history record of the window object

window.history.pushState(object, title, new_url) -- Add a new history record point in window.history

window.history.replaceState(object, title, new_url) -- Replace the history record point of the current page in window.history

object - You can expand the desired object

title - Currently All browsers do not support

new_url. The browser will not check whether the url exists. It only changes the url. The url must be in the same domain and cannot cross domains.

eg: original url: www.test.com

window.history.pushState({time: 'test'}, ' ', 'www.test_test.com')

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template