Java语言-92:JavaScript的对象-history对象

1、history对象中的方法
forward:装入历史列表中下一个url
back:装入历史列表中前一个url

go(正整数或者负整数)

2、简单举例:

            <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>history</title>
<script type="text/javascript">
function testForward(){
window.history.go(1);
}
function testBack(){
window.history.go(-1);
}
</script>
</head>
<a href="arr.html">超链接</a><br />
<input type="button" value="前进" onclick="testForward()">;
<input type="button" value="后退" onclick="testBack()">;
<body>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/qq_41833394/article/details/80826856
今日推荐