Automatically returned in 1.3 seconds
Copy codeThe Code is as follows:
<Span id = "totalSecond"> 3 </span> seconds later
<Script language = "javascript" type = "text/javascript">
<! --
Var second = document. getElementById ('totalsecond'). textContent;
If (navigator. appName. indexOf ("Explorer")>-1) // determines whether the browser is an IE browser or a Firefox browser.
{
Second = document. getElementById ('totalsecond'). innerText;
} Else
{
Second = document. getElementById ('totalsecond'). textContent;
}
SetInterval ("redirect ()", 1000); // call the redirect () method once 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>