Home > Web Front-end > H5 Tutorial > body text

HTML5 changes current url without refresh

怪我咯
Release: 2017-04-30 10:03:33
Original
3494 people have browsed it

This article mainly shares with you the HTML5 code for changing the current url without refreshing. Friends who need it can refer to it

window.history.back();//Back
window.history.forward() ;//Forward
window.history.go(-1);//Move to the specified recording point, currently going backwards by 1, which is equivalent to window.history.forward()
window.history.length//You can understand How many record points are there in history?

The above are just incidental when checking information

Let’s talk about it

history.pushState and history.replaceState

history.pushState will add a history record,

history.replaceState will replace it without adding it, so it will be more comfortable.

The above is the detailed content of HTML5 changes current url without refresh. For more information, please follow other related articles on the PHP Chinese website!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!