3秒后自动跳转到另一个页面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <span >请等待!!</span> <span id="second" >3</span> <!-- 跳转--> <script type="text/javascript"> var num = document.getElementById("second").innerHTML; //获取显示秒数的元素,通过定时器来更改秒数。 function count() { num--; document.getElementById("second").innerHTML=num; if(num==0) { location.assign("tiaozhuan.php"); } } setInterval("count()",1000); //通过window的location和history对象来控制网页的跳转。 function back() { window.history.back(); } </script> </body> </html>