技术文章分类(180)

技术随笔(11)

location.href和location.replace区别

假设默认在1.html中,触发进入到2.html时,然后

在2.html中分两种情况:

1、window.location.href = "3.html";   则在3.html中点击返回按钮时,回到2.html

2、window.location.replace = "3.html"; 则在3.html中点击返回按钮时,回到1.html

 

posted @ 2014-05-21 08:46  坤哥MartinLi  阅读(109)  评论(0编辑  收藏  举报