window.location.href和window.location.replace的区别
2017-08-16 11:58
316 查看
在页面中逐级进行点击请求以下页面:a.html->b.html->c.html
window.location.href 做跳转 window.history.go(-1);window.history.back(); 方法时,会向服务器进行请求,根据服务器记录的请求进行跳转,因此会正确返回对应的页面b.html。
window.location.replace 做跳转 window.history.go(-1);window.history.back(); 方法时,不会向服务器进行请求,因此只会跳转至a.html,未能返回到上级b.html。
转自:http://www.cnblogs.com/wanghaokun/p/5962169.html
window.location.href 做跳转 window.history.go(-1);window.history.back(); 方法时,会向服务器进行请求,根据服务器记录的请求进行跳转,因此会正确返回对应的页面b.html。
window.location.replace 做跳转 window.history.go(-1);window.history.back(); 方法时,不会向服务器进行请求,因此只会跳转至a.html,未能返回到上级b.html。
转自:http://www.cnblogs.com/wanghaokun/p/5962169.html
相关文章推荐
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.replace 和 window.location.href 的区别
- window.location.href和window.location.replace的区别
- window.location.href,window.location.replace(),window.location.reload() 三者的区别
- 总是在资料上看到 window.location.href和window.location.replace的区别,但是不是很明白,今天彻底明白了。简单说说: 有3个jsp页面(1.jsp,
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href,window.location.replace(),window.location.reload() 三者的区别