下面的JS代码可以通过点击按钮转向下一页,当然必须用户曾经返回过上一页才能 进行此操作,否则无效。
<!DOCTYPE html> <html> <head> <script> function goForward() { window.history.forward() } </script> </head> <body> <input type="button" value="Forward" onclick="goForward()"> <p>Notice that clicking on the Forward button here will not result in any action, because there is no next URL in the history list.</p> </body> </html>