Javascript 中的 history对象

Javascript 中的 history对象

第一个html页面: js18.html

<!DOCTYPE html>
<html>
  <head>
    <title>js18.html</title>
  </head>
  
  <body>
    <a href="js19.html">js19.html</a>
  </body>
</html>

第二个html页面: js19.html

<!DOCTYPE html>
<html>
  <head>
    <title>js19.html</title>
  </head>
  
  <body>
    <a href="#" onclick="history.back();">Back</a>
  </body>
</html>

所以第一个页面中单击 js19.html link,会跳到 js19.html 页面。这是点击 Back link,会回到 js18.html。

原文地址:https://www.cnblogs.com/backpacker/p/2615881.html