javascript:history
javascript的history对象中历史序列长度history.length属性获得,go(-1)相当于back(),go(1)相当于forward()。
go(n)前进n页,go(-n)后退n页。
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>javascript:history</title> <script type="text/javascript"> document.write(history.length); </script> </head> <body> <button onclick="javascript:history.forward()">前进</button> <button onclick="javascript:history.back()">后退</button> <button onclick="javascript:history.go(-1)">后退</button> <button onclick="javascript:history.go(1)">前进</button> <a href="http://www.qingzz.cn">迷津渡口</a> </body> </html>
点赞0
支持一下