首页 > Web开发 > 详细

js_外部对象_location

时间:2017-10-07 14:16:34      阅读:457      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>location地址栏</title>
<script type="text/javascript">
function f1() {
var b=confirm("你确定离开本页面么???")

if(b){
//跳转
location.href="http://www.baidu.com";
}
}
function f2() {
//刷新
location.reload();
}
</script>
</head>
<body>
<input type="button" value="百度"
onclick="f1();">
<input type="button" value="刷新"
onclick="f2();">
</body>
</html>

js_外部对象_location

原文:http://www.cnblogs.com/Bighua123/p/7634368.html

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