<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<h1>history1</h1>
<button id="new">先打开网页</button>
<button id="forward">前进</button>
<button id="length">获取历史记录长度</button>
<script>
document.getElementById('new').οnclick=function(){
location.href='history2.html';
}
document.getElementById('forward').οnclick=function(){
history.forward();
}
document.getElementById('length').οnclick=function(){
alert('历史记录长度为'+history.length);
}
</script>
</body>
</html>
打开网页前进获取历史记录长度
最新推荐文章于 2024-11-12 11:47:35 发布