为什么点返回键不直接跳转网页
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程练习</title> </head> <body> <h1>操作成功</h1> <span id="second">5</span> <span>秒后返回主页</span> <a href="javascript:back()">返回</a> <script type="text/javascript"> var num =document.getElementById("second").innerHTML; function count() { num--; document.getElementById("second").innerHTML=num; if (num==0){ location.assign("http://www.imooc.com"); } } setInterval("count()",1000); function back() { window.history.back(); } </script> </body> </html>
为什么点返回键 不直接跳转网页