首页 > Web开发 > 详细

js5——页面转换

时间:2019-11-30 19:04:55      阅读:63      评论:0      收藏:0      [点我收藏+]

 

 

 

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

</head>
<body>
<input type="button" id="btn" value="刷新">
<input type="button" id="goItcast" 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);
//点击按钮去访问www.itcast.cn官网
var goItcast=document.getElementById("goItcast");
goItcast.onclick=function () {
location.href="https://www.baidu.com";
}
var href=location.href;
</script>
</body>
</html>

 

 

技术分享图片

 

 

js5——页面转换

原文:https://www.cnblogs.com/soyadios/p/11963455.html

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