企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
代码如下所示 ~~~ <!DOCTYPE html> <html> <head> <title>浏览器对象</title> <meta http-equiv="Content-Type" content="text/html; charset=gkb"/> </head> <body> <!--先编写好网页布局--> <h3>操作成功</h3> <p><span id="timer"></span>秒后回到主页&nbsp<a href="javascript:b()">返回</a></p> <script type="text/javascript"> var num=5; function timer(){ if(num>0){ document.getElementById("timer").innerHTML=num; num--; } else if(num==0){ window.location.assign("http://www.baidu.com"); } } var i=setInterval(timer,2000); function b(){ window.history.go(-1); } //获取显示秒数的元素,通过定时器来更改秒数。 //通过window的location和history对象来控制网页的跳转。 </script> </body> </html> ~~~