当前的url下标为0,所以window.history.go(-1)就是要定位到相对当前页面下标为-1的页面,也就是之前刚刚访问的页面。
history.back()和history.go(-1)都是返回之前页面,但是方法不同,所以是有区别的:
总结:
当前的url下标为0,所以window.history.go(-1)就是要定位到相对当前页面下标为-1的页面,也就是之前刚刚访问的页面。
history.back()和history.go(-1)都是返回之前页面,但是方法不同,所以是有区别的:
总结:
上一篇:jQuery倒计时进度条
下一篇:JS实现文字向上无缝滚动轮播
Vue返回上一个页面时如何触发上一个页面的方法
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M