history: reload & replace

learning mark

 

There are 3 pages (a.html, b.html, c.html).
The a.html page is opened by default, and then a link in the a.html page turns to the b.html page.
Now, I use window.location.replace("c.html"); and window.location.href("c.html"); in the b.html page to enter the c.html page respectively.
From the user interface There is no difference, but now the c.html page has a "return" button,
use window.location.href("c.html"); When entering the c.html page
    , the call window.history in the c.html page .go(-1);wondow.history.back(); When entering the c.html page, if you click the "return" button to return to the b.html page,


And if you use window.location.replace("c.html"); to enter the c.html
    page, the call window.history.go(-1);wondow.history.back(); method in the c.html page is If it is not easy to use, it will return to a.html.

 

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

 

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326484181&siteId=291194637