Detailed example of teaching you how to use H5 to change the current URL without refreshing

Y2J
Release: 2017-05-22 13:44:45
Original
2936 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();//后退 window.history.forward();//前进 window.history.go(-1);//移动到指定记录点,当前倒退1,相当于window.history.forward() window.history.length//可以了解历史中有多少个记录点
Copy after login

The above is just incidental when checking the information

The following is discussed

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.

【Related recommendations】

1.HTML5 free video tutorial

2.Detailed tutorial on operating the database through phonegap

3.Detailed explanation of how to use indexedDB database in H5

4.Why HTML5 is getting more and more advantages now

5.\9 and \0 may hack IE11\IE9\IE8 Detailed explanation of why it is invalid

The above is the detailed content of Detailed example of teaching you how to use H5 to change the current URL without refreshing. 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
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!