<!DOCTYPE html><html> <head> <title>浏览器对象</title> <meta http-equiv="Content-Type" content="text/html; charset=gkb"/> </head> <body> <!--先编写好网页布局--> <h1>操作成功</h1> <p><span id="clock">5</span>秒后回到主页<a href="javascript:back()">返回</a></p> <script type="text/javascript"> var num=document.getElementById("clock").innerHTML; function count(){ num--; document.getElementById("clock").innerHTML=num; if(num==0) { window.open('https://www.imooc.com','_blank','width=400,height=400'); } } setInterval("count()",1000); function back(){ window.history.back(); } </script></body></html>
这一句写错了: window.open('https://www.imooc.com','_blank','width=400,height=400');改为 window.location.href="https://www.imooc.com/"; 如何还不行,就是细节问题了