Automatically return after 1.3 seconds
The code copy is as follows:
<span id="totalSecond">3</span>Return automatically after 3 seconds
<script language="javascript" type="text/javascript">
<!--
var second = document.getElementById('totalSecond').textContent;
if (navigator.appName.indexOf("Explorer") > -1) //Judge whether it is an IE browser or a Firefox browser, and use the corresponding measures to obtain the number of seconds
{
second = document.getElementById('totalSecond').innerText;
} else
{
second = document.getElementById('totalSecond').textContent;
}
setInterval("redirect()", 1000); //Call the redirect() method every 1 second
function redirect()
{
if (second < 0)
{
location.href = 'http://www.baidu.com';
} else
{
if (navigator.appName.indexOf("Explorer") > -1)
{
document.getElementById('totalSecond').innerText = second--;
} else
{
document.getElementById('totalSecond').textContent = second--;
}
}
}
-->
</script>