首页 > 编程语言 > 详细

JavaScript history属性

时间:2019-10-30 20:35:12      阅读:70      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>

<input type="button" value="前进" onclick="func1();">
<input type="button" value="后退" onclick="func2();">
<a href="history_lesson2.html">lesson</a>

<script>
function func1() {
//history.forward();
history.go(2);
}
// history内部三种方法:forward back go 一个属性:length

function func2() {
//history.back();
history.go(-1);
alert(history.length);
}

</script>
</body>
</html>

JavaScript history属性

原文:https://www.cnblogs.com/gerenboke/p/11767383.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!