var seconds = 3;
var defaultUrl = "{$default_url}";
{literal}
onload = function()
{
if (defaultUrl == 'javascript:history.go(-1)' && window.history.length == 0)
{
document.getElementById('redirectionMsg').innerHTML = '';
return;
}
window.setInterval(redirection, 1000);
}
function redirection()
{
if (seconds <= 0)
{
window.clearInterval();
return;
}
seconds --;
document.getElementById('spanSeconds').innerHTML = seconds;
if (seconds == 0)
{
window.clearInterval();
location.href = defaultUrl;
}
}
JS interval
最新推荐文章于 2024-05-01 15:56:17 发布