[JavaScript] JavaScript通过history对象控制网页返回指定的历史页面 →→→→→进入此内容的聊天室

来自 , 2021-03-10, 写在 JavaScript, 查看 99 次.
URL http://www.code666.cn/view/d28d76b4
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. function goBack()
  6.   {
  7.   window.history.go(-2)
  8.   }
  9. </script>
  10. </head>
  11. <body>
  12.  
  13. <input type="button" value="Go 2 pages back" onclick="goBack()">
  14.  
  15. <p>Notice that clicking on the "Go 2 pages back" button here will not result in any action, because there is no previous URL in the history list.</p>
  16.  
  17. </body>
  18. </html>
  19.  
  20. //javascript/7895

回复 "JavaScript通过history对象控制网页返回指定的历史页面"

这儿你可以回复上面这条便签

captcha