history: reload & replace

学习mark

有3个页面(a.html, b.html, c.html).
默认打开a.html页面,然后在a.html页面中通过一个链接转向b.html页面。
现在,我在b.html页面中用window.location.replace("c.html");与用window.location.href("c.html");分别进入c.html页面.
从用户界面来看是没有什么区别的,但是现在c.html页面有一个“返回”按钮,
用window.location.href("c.html");进入c.html页面时,
    c.html页面中的调用window.history.go(-1);wondow.history.back();进入c.html页面时,一点这个"返回"按钮就要返回b.html页面的话,


而如果用window.location.replace("c.html");进入c.html页面的话,
    c.html页面中的调用window.history.go(-1);wondow.history.back();方法是不好用的,会返回到a.html.

http://www.cnblogs.com/lina6251125/p/6392299.html

http://zccst.iteye.com/blog/2162658

猜你喜欢

转载自luqingxuan.iteye.com/blog/2395808