JavaScript history属性

大城市里の小女人 提交于 2019-12-02 23:36:13

<!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>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!