点击按钮返回上一页,主要通过history.back方法实现
<!DOCTYPE html> <html> <head> <script> function goBack() { window.history.back() } </script> </head> <body> <input type="button" value="Back" onclick="goBack()"> <p>Notice that clicking on the Back button here will not result in any action, because there is no previous URL in the history list.</p> </body> </html>