为什么直接在练习里面测试没有效果,在本地用浏览器却有效果?
来源:2-7 编程练习
为你浅笑
2019-06-16 00:54:52
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>location方法</title>
</head>
<body>
<input type="button" value="操作页面" id="ck">
<script type="text/javascript">
//补充代码
var a=document.getElementById("ck");
a.onclick=function(){
var b=confirm("刷新页面么?");
if(b==true){
location.reload();
}else{
location.replace("http://www.imooc.com");
}
}
</script>
</body>
</html>
1回答
同学您好,因为在线编辑器的功能限制,因此,本次练习题需要在本地测试哦
希望可以帮到你!
相似问题