<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>location方法练习</title></head><body> <input type="button" value="操作页面" id="ck"> <script type="text/javascript"> var click=document.getElementById("ck"); click.onclick=function(){ var a=window.confirm("刷新页面么"); if (a==true) { location.reload(); }else{ location.repalce("http://www.imooc.com"); } } </script></body></html>
添加回答
举报
0/150
提交
取消