日期:2014-05-17 浏览次数:20423 次
Response.Write(" <script>window.setTimeout(/"window.location='Demo.aspx'/",3000); </script>");
<html xmlns="http://111cn.net/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=gb2312" /> <title>js延时自动跳转到指定页面的跳转代码</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script> </script> </head> <body> /*页面显示10秒后跳转*/ <div id="tiao">10</div><a href="javascript:countDown"></a>秒后自动跳转… <script language="javascript" type=""> function countDown(secs){ if(--secs>0){ $("#tiao").text(secs);/*设置页面每秒秒数减少*/ setTimeout("countDown("+secs+")",1000);/*利用setTimeout每隔一秒调用一次*/ }else{ location.href="http://www.baidu.com"/*这里是要跳转的页面*/ } } countDown(10);/*设置多少秒跳转*/ </script> </body> </html>
------解决方案--------------------
函数
window.setTimeout(function(){window.location='Demo.aspx'},3000);