H5如何实现该功能?
1、 这个方法就能实现:location.replace("index.html") 有关闭当前页面,跳转到新页面 的效果。
2、 而我们常用的 window.location.href = “index.html”, 这个方法会保留历史的访问记录。
本文介绍了两种H5页面跳转的方法:使用location.replace进行页面跳转并关闭当前页面;使用window.location.href进行页面跳转但保留历史记录。这两种方法在实际应用中各有优势。
H5如何实现该功能?
1、 这个方法就能实现:location.replace("index.html") 有关闭当前页面,跳转到新页面 的效果。
2、 而我们常用的 window.location.href = “index.html”, 这个方法会保留历史的访问记录。
2891
638

被折叠的 条评论
为什么被折叠?
