简体   繁体   中英

History API - replaceState on a previous page?

想知道我是否可以使用HTML5历史记录API的replaceState()方法(或类似方法)来更改以前访问的页面(与当前页面相对)的状态?

After doing more research...

Strictly speaking, you can't use replaceState() to change where back navigation will go to. However, you can listen to the popstate event and navigate accordingly.

Additional documentation:

Mozilla's guide to 'Manipulating the browser history'

Mozilla's window.history documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM