好吧,我想知道在使用Ajax重定向之前如何延迟,因为我已经包含了退出启动页面。
这是代码:
setTimeout(5000);
window.location = "https://www.google.com"
我也试过这个:
setTimeout(function(){ document.location = 'http://www.google.com';}, 2000);
我也尝试过:
delay : 3000
启动页面javascript:
<!-- Start of ExitSplash.com Code -->
<script language="javascript">
var exitsplashmessage = '***************************************\n\n W A I T B E F O R E Y O U G O !\n\n CLICK THE *CANCEL* BUTTON RIGHT NOW\n TO STAY ON THE CURRENT PAGE.\n\n I HAVE SOMETHING VERY SPECIAL FOR YOU!\n\n***************************************';
var exitsplashpage = 'http://www.facebook.com';
</script>
<script language="javascript" src="http://www.google/bonus/exitsplash.php?tc=3399cc&uh=none&ad=none&sh=no&hv=no&bh=22&fs=12&lf=Arial&at=Powered%20by%20ExitSplash"></script>
<!-- End of ExitSplash.com Code -->
答案 0 :(得分:0)
setTimeout(functionName(),5000);
function functionName()
{
document.location = 'http://www.google.com';
}
答案 1 :(得分:0)
试一试。
setTimeout(function(){document.location.href="http://www.google.com";}, 3000);