<!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.xianlaiwan.cn");? ? ? ? ? ?}? ? ? ?}? ?</script></body></html>
為什么這個不跳轉呢? location.repalce("http://www.xianlaiwan.cn");錯在哪里?
祀未
2017-04-27 23:04:28