Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> JavaScript

Tải URL tiếp theo trong lịch sử với JavaScript

Sử dụng history.forward() để điều hướng tới URL tiếp theo trong lịch sử (nếu có).

Ví dụ

<!DOCTYPE html>
<html>
  <body>
    <script>
      function nextPage() { window.history.forward(); }
    </script>
    <input type="button" value="Next URL" onclick="nextPage()">
  </body>
</html>