页面转换
标签:
<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<input type="button" value="刷新">
<input type="button" value="去传智">
<script>
//reload方法,定义一个按钮 刷新当前的页面
// var h1=window.history;
// var h2=history;
// alert(h1);
// alert(h2);
// setInterval(fun,3000);
// function fun() {
// alert("name")
// }
var btn=document.getElementById(btn);
btn.onclick=function () {
location.reload();
}
// alert(href);
//点击按钮去访问官网
var goItcast=document.getElementById("goItcast");
goItcast.onclick=function () {
location.href="https://www.baidu.com";
}
var href=http://www.mamicode.com/location.href;
</script>
</body>
</html>
js5——页面转换
,温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/42170.html
- 上一篇:通栏平均分布
- 下一篇:PHP安装扩展补充说明